@Test public void testThatAllExpectedMmsisAreReturnedByTracker() throws Exception { Set<TargetInfo> targets = aisTrackService.targets(); int[] mmsis = targets.stream().mapToInt(t -> t.getMmsi()).distinct().toArray(); for (int mmsi : mmsis) { assertThat(mmsi, new CustomMatcher<Integer>("Tracked MMSI must in in list of expected MMSI's") { @Override public boolean matches(Object o) { for (int i = 0; i < mmsiInTestData.length; i++) { if (mmsiInTestData[i] == mmsi) return true; } return false; } }); } }
public Set<TargetInfo> targets() { return tracker .streamSequential() .collect(Collectors.toSet()); }
AisTrackService { public Set<TargetInfo> targets() { return tracker .streamSequential() .collect(Collectors.toSet()); } }
AisTrackService { public Set<TargetInfo> targets() { return tracker .streamSequential() .collect(Collectors.toSet()); } AisTrackService();  AisTrackService(Predicate<AisPacket> trackerInputPacketFilter); }
AisTrackService { public Set<TargetInfo> targets() { return tracker .streamSequential() .collect(Collectors.toSet()); } AisTrackService();  AisTrackService(Predicate<AisPacket> trackerInputPacketFilter); int numberOfTargets(); int numberOfTargets(Predicate<? super AisPacketSource> packetSourceFilter); Set<TargetInfo> targets(); Set<TargetInfo> targets(Predicate<? super AisPacketSource> packetSourceFilter, Predicate<? super TargetInfo> targetInfoFilter); TargetInfo target(int mmsi, Predicate<? super AisPacketSource> packetSourceFilter); void start(); void stop(); static void main(String[] args); }
AisTrackService { public Set<TargetInfo> targets() { return tracker .streamSequential() .collect(Collectors.toSet()); } AisTrackService();  AisTrackService(Predicate<AisPacket> trackerInputPacketFilter); int numberOfTargets(); int numberOfTargets(Predicate<? super AisPacketSource> packetSourceFilter); Set<TargetInfo> targets(); Set<TargetInfo> targets(Predicate<? super AisPacketSource> packetSourceFilter, Predicate<? super TargetInfo> targetInfoFilter); TargetInfo target(int mmsi, Predicate<? super AisPacketSource> packetSourceFilter); void start(); void stop(); static void main(String[] args);  }