* 327, 654, 617, 1234, 697, 740, 1231, 1228, 728, 716, 1199, 1170
*
*/
@Test
public void testNumberValue_TwoInstancesTwoGroups() {
TestScheduler scheduler = new TestScheduler();
TestSubject<GroupedObservable<InstanceKey, Map<String, Object>>> stream = TestSubject.create(scheduler);
AtomicInteger numGroups = new AtomicInteger();
TestSubscriber<Object> ts = new TestSubscriber<>();
StreamAggregator.aggregateGroupedStreams(stream).flatMap(commandGroup -> {
System.out.println("======> Got group for command: " + commandGroup.getKey());
numGroups.incrementAndGet();
return commandGroup.map(data -> {
return data.get("rollingCountSuccess");
});
}).subscribe(ts);
stream.onNext(getSubscriberAndCinematchCommandInstanceStream(12345, scheduler), 0);
stream.onNext(getSubscriberAndCinematchCommandInstanceStream(23456, scheduler), 5);
stream.onCompleted(100);
scheduler.advanceTimeBy(100, TimeUnit.MILLISECONDS);
ts.awaitTerminalEvent();
System.out.println("---------> OnErrorEvents: " + ts.getOnErrorEvents());
if (ts.getOnErrorEvents().size() > 0) {