public static <A> void forEach(final Iterable<? extends A> as, final SideEffect1<A> e) { for (final A a : as) { e.apply(a); } }
public ClassInfo(final ClassPointer superClass, final ClassPointer outerClass, final ClassInfoBuilder builder) { this.superClass = superClass; this.outerClass = outerClass; this.id = builder.id; this.access = builder.access; this.codeLines = builder.codeLines; this.annotations = FCollection.map(builder.annotations, ClassName.stringToClassName()); this.sourceFile = builder.sourceFile; this.classAnnotationValues = builder.classAnnotationValues; }
public Collection<String> extractCallDependenciesForPackages( final String clazz, final Predicate<String> targetPackages, final Predicate<DependencyAccess> doNotTraverse) throws IOException { final Set<String> allDependencies = extractCallDependencies(clazz, doNotTraverse); return FCollection.filter(allDependencies, targetPackages); }
@Test public void flatMapShouldTreatNullAsEmptyIterable() { assertEquals(Collections.emptyList(), FCollection.flatMap(null, objectToObjectIterable())); }
public int getNumberOfTestsRun() { final BiFunction<Integer, MutationResult, Integer> sum = (a, b) -> a + b.getNumberOfTestsRun(); return FCollection.fold(sum, 0, this.data); }
public static <T> List<T> filter(final T[] xs, final Predicate<T> predicate) { final List<T> dest = new ArrayList<>(); filter(xs, predicate, dest); return dest; }
private void signalRunEndToAllListeners() { FCollection.forEach(this.listeners, a -> a.runEnd()); }
private Function<ClassName, Stream<ClassInfo>> nameToClassInfo() { return new NameToClassInfo(this.classRepository) .andThen(opt -> Streams.fromOptional(opt)); }
@Test public void flatMapShouldTreatNullAsEmptyIterable() { assertEquals(Collections.emptyList(), FArray.flatMap(null, objectToObjectIterable())); }
private boolean shouldInstrument(final int access, final String name, final String desc, final String signature, final String[] exceptions) { return this.filter.apply(access, name, desc, signature, exceptions); }
@Override public Collection<String> getMutatorNames() { return FCollection.map(this.mutationOperators, toName()); }
private void callListenerFunction(final ResultType testee) { testee.getListenerFunction(this.result).apply(this.listener); } }
private static List<ClassPathRoot> wrapToAvoidIOOperations( List<ClassPathRoot> roots) { return FCollection.map(roots, NameCachingRoot.toCachingRoot()); }
private Collection<Predicate<String>> globStringsToPredicates( final List<String> excludedMethods) { return FCollection.map(excludedMethods, Glob.toGlobPredicate()); }
public List<MethodTree> methods() { if (this.lazyMethods != null) { return this.lazyMethods; } this.lazyMethods = FCollection.map(this.rawNode.methods, toTree(name())); return this.lazyMethods; }
@Override public Collection<MutationResult> analyse( final Collection<MutationDetails> mutationsForClasses) { return FCollection.map(mutationsForClasses, mutationToResult()); }