Source:
<code>public SuccessfulCompilationClause generatesSources(JavaFileObject first, JavaFileObject... rest) { ImmutableList<JavaFileObject> generatedSources = result.generatedSources(); Iterable<? extends CompilationUnitTree> actualCompilationUnits = Compilation.parse(generatedSources); final EqualityScanner scanner = new EqualityScanner(); for (final CompilationUnitTree expected : Compilation.parse(Lists.asList(first, rest))) { Optional<? extends CompilationUnitTree> found = Iterables.tryFind(actualCompilationUnits, new Predicate<CompilationUnitTree>() { @Override public boolean apply(CompilationUnitTree input) { return scanner.visitCompilationUnit(expected, input); } }); if (!found.isPresent()) { ImmutableMap<String, JavaFileObject> p = FluentIterable.from(generatedSources) .uniqueIndex(new Function<JavaFileObject, String>() { @Override <START> @Nullable <END> public String apply(@Nullable JavaFileObject input) { String path = input.toUri().getPath(); return path.substring(StandardLocation.SOURCE_OUTPUT.name().length() + 2); } }); JavaFileObject actual = p.get(expected.getSourceFile().toUri().getPath()); String expectedPath = expected.getSourceFile().getName(); if (actual != null) { CharSequence actualSource = null; try { actualSource = actual.getCharContent(true); } catch (IOException ignored) failureStrategy.fail("Generated file " + expectedPath + " did not match expectation. Found:\n" + (actualSource == null ? "no source found" : actualSource)); } else { failureStrategy.fail("Did not find a source file coresponding to " + expectedPath); } } } return this; }</code><technical_language>remove argument is true in case</technical_language>

Target:
public SuccessfulCompilationClause generatesSources(JavaFileObject first, JavaFileObject... rest) { ImmutableList<JavaFileObject> generatedSources = result.generatedSources(); Iterable<? extends CompilationUnitTree> actualCompilationUnits = Compilation.parse(generatedSources); final EqualityScanner scanner = new EqualityScanner(); for (final CompilationUnitTree expectedTree : Compilation.parse(Lists.asList(first, rest))) { Optional<? extends CompilationUnitTree> found = Iterables.tryFind(actualCompilationUnits, new Predicate<CompilationUnitTree>() { @Override public boolean apply(CompilationUnitTree actualTree) { return scanner.visitCompilationUnit(expectedTree, actualTree); } }); if (!found.isPresent()) { final JavaFileObject expected = expectedTree.getSourceFile(); Optional<JavaFileObject> actual = FluentIterable.from(generatedSources).firstMatch(new Predicate<JavaFileObject>() { @Override public boolean apply(JavaFileObject generatedFile) { return generatedFile.toUri().getPath().endsWith(expected.toUri().getPath()); } }); if (actual.isPresent()) { CharSequence actualSource = null; try { actualSource = actual.get().getCharContent(false); } catch (IOException e) { throw new RuntimeException("Exception reading source content.", e); } failureStrategy.fail("Generated file " + expected.getName() + " did not match expectation. Found:\n" + (actualSource == null ? "no source found" : actualSource)); } else { failureStrategy.fail("Did not find a source file named " + expected.getName()); } } } return this; }