Append /src to an Optional path
Sure there is! You're looking for Optional.map


  If a value is present, apply the provided mapping function to it, and if the result is non-null, return an Optional describing the result. Otherwise return an empty Optional.


Optional&lt;Path&gt; getSrcDir() {
    return getProjectDir().map(p -&gt; p.resolve("src"));
}