diff --git a/src/test/java/com/google/devtools/build/lib/cmdline/ParallelVisitorTest.java b/src/test/java/com/google/devtools/build/lib/cmdline/ParallelVisitorTest.java index f14724a3ad3c60..32dfd0f670b3f4 100644 --- a/src/test/java/com/google/devtools/build/lib/cmdline/ParallelVisitorTest.java +++ b/src/test/java/com/google/devtools/build/lib/cmdline/ParallelVisitorTest.java @@ -23,7 +23,6 @@ import com.google.devtools.build.lib.concurrent.ThreadSafety.ThreadSafe; import com.google.devtools.build.lib.testutil.TestThread; import java.util.ArrayList; -import java.util.Optional; import java.util.Set; import java.util.concurrent.CountDownLatch; import java.util.concurrent.Executors; @@ -153,12 +152,7 @@ protected Visit getVisitResult(Iterable values) { synchronized (this) { visits.add(values); } - return new Visit( - values, - Iterables.concat( - Iterables.transform( - values, - v -> Optional.ofNullable(successorMap.get(v)).orElse(ImmutableList.of())))); + return new Visit(values, Iterables.concat(Iterables.transform(values, successorMap::get))); } @Override