You can use `exists` on the Option returned by `.get(moduleID.key)`. This also protects against the case where there's a classpath entry without associated moduleID.

```scala
classpath.find(_.get(sbt.Keys.moduleID.key).exists(m => m.organization == "org.scala-lang" && m.name == "scala-library")).map(_.data.getAbsolutePath)
```

There's also a `ModuleFilter` that can be used. Something like:

```scala
classpath.find(_.get(moduleID.key).exists(moduleFilter(organization = "org.scala-lang", name = "scala-library")))
```