### Question:
FlowLogDBService implements FlowLogService { public Boolean hasPendingFlowEvent(List<FlowLog> flowLogs) { LOGGER.debug("Checking if there is a pending flowEvent based on these flowLogs {}", Joiner.on(",") .join(flowLogs.stream().map(flowLog -> flowLog.minimizedString()).collect(Collectors.toList()))); return flowLogs.stream().anyMatch(pendingFlowLogPredicate()); }  FlowLog save(FlowParameters flowParameters, String flowChanId, String key, Payload payload, Map<Object, Object> variables, Class<?> flowType,
            FlowState currentState); String getSerializedString(Object object); @Override Iterable<FlowLog> saveAll(Iterable<FlowLog> flowLogs); FlowLog close(Long stackId, String flowId); FlowLog cancel(Long stackId, String flowId); FlowLog terminate(Long stackId, String flowId); void saveChain(String flowChainId, String parentFlowChainId, Queue<Selectable> chain, String flowTriggerUserCrn); void updateLastFlowLogStatus(FlowLog lastFlowLog, boolean failureEvent); void cancelTooOldTerminationFlowForResource(Long resourceId, long olderThan); boolean isOtherNonTerminationFlowRunning(Long resourceId); boolean isOtherFlowRunning(Long resourceId); boolean repeatedFlowState(FlowLog lastFlowLog, String event); void updateLastFlowLogPayload(FlowLog lastFlowLog, Payload payload, Map<Object, Object> variables); Optional<FlowLog> getLastFlowLog(String flowId); @Override Set<String> findAllRunningNonTerminationFlowIdsByStackId(Long resourceId); @Override Optional<FlowLog> findFirstByFlowIdOrderByCreatedDesc(String flowId); @Override Optional<FlowChainLog> findFirstByFlowChainIdOrderByCreatedDesc(String flowChainId); @Override List<Object[]> findAllPending(); @Override Set<FlowLog> findAllUnassigned(); @Override Set<FlowLog> findAllByCloudbreakNodeId(String cloudbreakNodeId); List<FlowLog> findAllByResourceIdOrderByCreatedDesc(Long id); List<FlowLog> findAllByResourceIdAndFinalizedIsFalseOrderByCreatedDesc(Long id); @Override int purgeFinalizedFlowLogs(); List<FlowLog> findAllByFlowIdOrderByCreatedDesc(String flowId); Long getResourceIdByCrnOrName(String resource); FlowLog getLastFlowLogByResourceCrnOrName(String resource); List<FlowLog> getFlowLogsByResourceCrnOrName(String resource); Set<String> getFlowIdsByChainIds(Set<String> flowChainIds); List<FlowLog> getFlowLogsByFlowIdsCreatedDesc(Set<String> flowIds); Boolean hasPendingFlowEvent(List<FlowLog> flowLogs); Predicate<FlowLog> pendingFlowLogPredicate();  }### Answer:
@Test public void testNoPendingFlowEvent() { Boolean actual = underTest.hasPendingFlowEvent(Lists.newArrayList(createFlowLog(false, "1"), createFlowLog(false, "2"))); assertEquals(Boolean.FALSE, actual); }
@Test public void testHasPendingFlowEvent() { Boolean actual = underTest.hasPendingFlowEvent(Lists.newArrayList(createFlowLog(true, "1"), createFlowLog(false, "2"))); assertEquals(Boolean.TRUE, actual); }