@Override public void forEach(Consumer<? super E> action) { checkNotNull(action); unfiltered.forEach( (E e) -> { if (predicate.test(e)) { action.accept(e); } }); }
@Override public void forEach(Consumer<? super T> action) { checkNotNull(action); unfiltered.forEach( (T a) -> { if (retainIfTrue.test(a)) { action.accept(a); } }); }
@Override public void forEach(Consumer<? super T> action) { checkNotNull(action); unfiltered.forEach( (T a) -> { if (retainIfTrue.test(a)) { action.accept(a); } }); }
@Override public void forEach(Consumer<? super E> action) { checkNotNull(action); unfiltered.forEach( (E e) -> { if (predicate.test(e)) { action.accept(e); } }); }
/** Returns whether a given APK generated by the Bundle Tool should be installed on a device. */ private boolean matchesApk( ApkTargeting apkTargeting, boolean isSplit, String moduleName, Predicate<String> moduleNameMatcher) { boolean matchesTargeting = matchesApkTargeting(apkTargeting); if (isSplit) { return matchesTargeting && moduleNameMatcher.test(moduleName); } else { if (matchesTargeting && requestedModuleNames.isPresent()) { throw CommandExecutionException.builder() .withMessage("Cannot restrict modules when the device matches a non-split APK.") .build(); } return matchesTargeting; } }
@Override public void forEach(Consumer<? super T> action) { checkNotNull(action); unfiltered.forEach( (T a) -> { if (retainIfTrue.test(a)) { action.accept(a); } }); }
@Override public void forEach(Consumer<? super E> action) { checkNotNull(action); unfiltered.forEach( (E e) -> { if (predicate.test(e)) { action.accept(e); } }); }
@Override public void forEach(Consumer<? super T> action) { checkNotNull(action); unfiltered.forEach( (T a) -> { if (retainIfTrue.test(a)) { action.accept(a); } }); }
@Override public void forEach(Consumer<? super E> action) { checkNotNull(action); unfiltered.forEach( (E e) -> { if (predicate.test(e)) { action.accept(e); } }); }
/** * Returns whether anything in {@code universe} matches {@code predicate}. * * <p>This method is designed to minimize allocations since it is expected to be called * <em>very</em> often. That's why is doesn't: * * <ul> * <li>instantiate {@link Iterator}s * <li>instantiate {@link Stream}s * <li>(un)box primitives * <li>expect closure generating lambdas * </ul> */ private static boolean anyMatch(Predicate<JSType> predicate, ImmutableList<JSType> universe) { for (int i = 0; i < universe.size(); i++) { if (predicate.test(universe.get(i))) { return true; } } return false; }
/** * Returns whether everything in {@code universe} matches {@code predicate}. * * <p>This method is designed to minimize allocations since it is expected to be called * <em>very</em> often. That's why is doesn't: * * <ul> * <li>instantiate {@link Iterator}s * <li>instantiate {@link Stream}s * <li>(un)box primitives * <li>expect closure generating lambdas * </ul> */ private static boolean allMatch(Predicate<JSType> predicate, ImmutableList<JSType> universe) { for (int i = 0; i < universe.size(); i++) { if (!predicate.test(universe.get(i))) { return false; } } return true; } }
@Override public Flowable<Entry<K, V>> apply(Iterable<K> t) { List<K> keys = Streams.stream(t) .filter(key -> filter.test(key)) .collect(Collectors.toList()); return delegate.apply(keys); } }
@Override public void start(RefetchHandler handler) { registration = eventBus.addHandler(FormChangeEvent.TYPE, event -> { if (predicate.test(event.getChange())) { // Our current result has become outdated, we need to fetch a new version from // the server handler.refetch(); } }); }
List<Entity> list = world.getEntitiesWithinAABB(Entity.class, bb.grow(range, range, range), input -> { if (predicateEntity == null) return true; else return predicateEntity.test(input); }); double closest = 0.0D;
if (targetBlock.canCollideCheck(targetState, false) && (predicateBlock == null || predicateBlock.test(targetBlock))) { RayTraceResult raytraceresult1 = targetState.collisionRayTrace(world, targetPos, start, end);