package de.retest.recheck.configuration;

import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Optional;
import java.util.Set;

import com.google.common.collect.Sets;

public class ProjectRootFinderUtil {

	private static final Set<ProjectRootFinder> projectRootFinder = Sets.newHashSet( new PathBasedProjectRootFinder() );

	private ProjectRootFinderUtil() {}

	public static Optional<Path> getProjectRoot() {
		final Path baseFolder = Paths.get( System.getProperty( ProjectConfiguration.RETEST_PROJECT_ROOT, "" ) );
		return getProjectRoot( baseFolder.toAbsolutePath() );
	}

	public static Optional<Path> getProjectRoot( final Path basePath ) {
		return projectRootFinder.stream() //
				.map( finder -> finder.findProjectRoot( basePath ) ) //
				.filter( Optional::isPresent ) //
				.map( Optional::get ) //
				.findAny();
	}

}

@@ -180,16 +180,61 @@
 .Sets;%0A%0A
+import de.retest.recheck.util.OptionalUtil;%0A%0A
 public c
@@ -814,13 +814,14 @@
 %09%09.f
-ilter
+latMap
 ( Op
@@ -830,48 +830,20 @@
 onal
-::isPresent ) //%0A%09%09%09%09.map( Optional::get
+Util::stream
  ) /

Use OptionalUtil