List of usage examples for java.util Collection removeIf
default boolean removeIf(Predicate<? super E> filter)
From source file:org.sonarsource.scanner.maven.bootstrap.MavenProjectConverter.java
private static void removeTarget(MavenProject pom, Collection<String> relativeOrAbsolutePaths) { final Path baseDir = pom.getBasedir().toPath().toAbsolutePath().normalize(); final Path target = Paths.get(pom.getBuild().getDirectory()).toAbsolutePath().normalize(); final Path targetRelativePath = baseDir.relativize(target); relativeOrAbsolutePaths.removeIf(pathStr -> { Path path = Paths.get(pathStr).toAbsolutePath().normalize(); Path relativePath = baseDir.relativize(path); return relativePath.startsWith(targetRelativePath); });/* w w w. java2s . c o m*/ }