Flow { public boolean filter(String path) { FlowPart flowPart = getPart(path, FlowStatus.CLEAN); if (flowPart == null) { return false; } flowPart.setFilterTime(currentTime()); flowPart.incrementFilterCount(); return true; } Flow();  Flow(String application); Long getIdentifier(); void setIdentifier(Long identifier); String getApplication(); void setApplication(String application); byte[] getPacket(); void setPacket(byte[] packet); Date getCreationTime(); void setCreationTime(Date start); Date getReplayTime(); void setReplayTime(Date replayTime); int getReplayCount(); void setReplayCount(int replayCount); void incrementReplayCount(); int getAckCountExpected(); void setAckCountExpected(int ackCountExpected); FlowStatus getDerivedStatus(); void setDerivedStatus(FlowStatus derivedStatus); Set<FlowPart> getParts(); FlowPart getPart(String path, FlowStatus status); FlowPart getPart(String path); String getFlowMessageText(); void setFlowMessageText(String message); boolean isAckCountExpectationSet(); boolean isAckCountExpectedReached(); int getStatusCount(FlowStatus status); FlowStatus getStatus(); void clearErrorStatus(); Date getLatestUpdate(); long getPartDuration(FlowPart part); void acknowledge(String path, boolean cleanup); void acknowledge(String path, boolean cleanup, String partMessageText); void invalidate(String path); void invalidate(String path, String partTextMessage); boolean filter(String path); boolean isReplayable(); byte[] prepareReplay(); @Override boolean equals(Object obj); @Override int hashCode(); FlowInfo getInfo(); FlowInfo getInfo(boolean includeText); static List<FlowInfo> getInfos(List<Flow> flows);  }
@Test public void testFilter() throws Exception { Flow flow = createFlow("blah"); flow.getPart("0.0").setStatus(ERROR); assertEquals(0, flow.getPart("0.0").getFilterCount()); assertEquals(0, flow.getPart("0.1").getFilterCount()); assertFalse(flow.filter("0.0")); assertTrue(flow.filter("0.1")); assertEquals(0, flow.getPart("0.0").getFilterCount()); assertEquals(1, flow.getPart("0.1").getFilterCount()); }