private void assertRemoveIfRemoves(final int requiredValue, final Integer... expectedValues) { final List<Integer> values = new ArrayList<>(asList(1, 2, 3)); assertEquals(1, removeIf(values, value -> value == requiredValue)); assertEquals(values, asList(expectedValues)); }
int attemptSteps() { return removeIf(polledUnitOfWorks, step -> step.attemptToAction() == CONTINUE); } }
private int checkDutyCycle() { return removeIf(replies, ResetSequenceNumberCommand::poll) + resendSaveNotifications(this.resendSlowStatus, SlowStatus.SLOW) + resendSaveNotifications(this.resendNotSlowStatus, SlowStatus.NOT_SLOW); }
private int pollLibraries(final long timeInMs) { int total = 0; final Iterator<LiveLibraryInfo> iterator = idToLibrary.values().iterator(); while (iterator.hasNext()) { final LiveLibraryInfo library = iterator.next(); total += library.poll(timeInMs); if (!library.isConnected()) { DebugLogger.log(LIBRARY_MANAGEMENT, "Timing out connection to library %s%n", library.libraryId()); iterator.remove(); library.releaseSlowPeeker(); tryAcquireLibrarySessions(library); saveLibraryTimeout(library); } } total += removeIf(librariesBeingAcquired, retryAcquireLibrarySessionsFunc); return total; }