@Override public void visitCurrentFirst(Consumer<T> action) { internalStack.forEach( action ); }
void addAll(MapperProviders other) { LinkedList<Function<GenericType<?>, Optional<? extends BiFunction<Config, ConfigMapper, ?>>>> otherProviders = new LinkedList<>(other.providers); Collections.reverse(otherProviders); otherProviders .forEach(this::add); }
index.remove(randomNum); index.forEach(i -> truncated.add(items.get(i)));
runningMachines.forEach( BoltStateMachine::close );
assertEquals("", content.substring(idx + 4)); MultiMap respHeaders = MultiMap.caseInsensitiveMultiMap(); records.forEach(record -> { int index = record.indexOf(":"); String value = record.substring(0, index);
value.forEach(internalPdxInstance -> { ArrayList innerObject = new ArrayList(); ((PdxInstance) internalPdxInstance).getFieldNames()
instances.forEach(instance -> traverseFields(instance.getClass()) .filter(f -> f.isAnnotationPresent(Inject.class)) .distinct()
entries.forEach(queEntry -> {
@Override protected void handleResponse(Response response, Request<List<Message>> request) { if (!response.isOk()) { request.onFailure(response); return; } EntityBuilder builder = api.get().getEntityBuilder(); LinkedList<Message> msgs = new LinkedList<>(); JSONArray historyJson = response.getArray(); for (int i = 0; i < historyJson.length(); i++) msgs.add(builder.createMessage(historyJson.getJSONObject(i))); msgs.forEach(msg -> history.put(msg.getIdLong(), msg)); request.onSuccess(msgs); } };
assertEquals("", content.substring(idx + 4)); MultiMap respHeaders = MultiMap.caseInsensitiveMultiMap(); records.forEach(record -> { int index = record.indexOf(":"); String value = record.substring(0, index);
private AbstractList<E> toList() { final LinkedList<E> out = new LinkedList<>(); items.forEach(i -> {E v = i.get(); if (v != null) out.add(v);}); return out; }
private String summarize(LinkedList<List<ResolvedFunction>> funcs) { List<List<String>> spans = new LinkedList<>(); funcs.forEach(l -> spans.add(l.stream().map(String::valueOf).collect(Collectors.toList()))); List<Optional<Integer>> widths = spans.stream().map( l -> l.stream().map(String::length).max(Integer::compare)).collect(Collectors.toList()); String summary = spans.stream().map( l -> l.stream().map(String::valueOf).collect(Collectors.joining("|\n")) ).collect(Collectors.joining("\n")); return summary; }
private void removeChildren(String key) { Lists.newLinkedList(translations.keySet()).forEach(k -> { if (ResourceKeys.isChildKeyOf(k, key)) { translations.remove(k); } }); }
public static void delete(Path path) throws IOException { final LinkedList<Path> onexit = new LinkedList<>(); Files.walkFileTree(path, new DirectoryTreeDeleteVisitor(onexit)); onexit.forEach(toDelete -> toDelete.toFile().deleteOnExit()); }
private void shutdownCleanup() { taskQueue = null; scheduledTaskList.forEach(tickScheduledTask -> tickScheduledTask.cancel(false)); scheduledTaskList = null; terminationFuture.complete(null); }
private void removeParents(String key) { Lists.newLinkedList(translations.keySet()).forEach(k -> { if (ResourceKeys.isChildKeyOf(key, k)) { translations.remove(k); } }); }
private LinkedList<CdoSnapshot> readSnapshots(String globalIdValue) { LinkedList<CdoSnapshot> result = new LinkedList<>(); if (!contains(globalIdValue)) { return result; } snapshots.get(globalIdValue).forEach(it -> result.add(jsonConverter.fromJson(it, CdoSnapshot.class))); return result; }
@Override public Map<String, BLangMarkdownParameterDocumentation> getParameterDocumentations() { Map<String, BLangMarkdownParameterDocumentation> parameterDocumentations = new HashMap<>(); parameters.forEach(p -> parameterDocumentations.put(p.getParameterName().getValue(), p)); return parameterDocumentations; }
private void visitIterableOperationInvocation(BLangInvocation iExpr) { IterableContext iContext = iExpr.iContext; if (iContext.operations.getLast().iExpr != iExpr) { result = null; return; } iContext.operations.forEach(operation -> rewrite(operation.iExpr.argExprs, env)); iterableCodeDesugar.desugar(iContext); result = rewriteExpr(iContext.iteratorCaller); }
@Benchmark int linkedListForEach(int reps) { int[] sumHolder = {0}; for (int i = 0; i < reps; i++) { linkedList.forEach(value -> sumHolder[0] += value.hashCode()); } return sumHolder[0]; }