@Test public void testTerminationConditionsEitherOf() { Instant now = Instant.now(); Watch.Growth.AfterTotalOf<Object> a = Growth.afterTotalOf(standardSeconds(5)); Watch.Growth.AfterTotalOf<Object> b = Growth.afterTotalOf(standardSeconds(10)); Watch.Growth.BinaryCombined< Object, KV<Instant, ReadableDuration>, KV<Instant, ReadableDuration>> c = eitherOf(a, b); KV<KV<Instant, ReadableDuration>, KV<Instant, ReadableDuration>> state = c.forNewInput(now, null); assertFalse(c.canStopPolling(now.plus(standardSeconds(3)), state)); assertTrue(c.canStopPolling(now.plus(standardSeconds(7)), state)); assertTrue(c.canStopPolling(now.plus(standardSeconds(12)), state)); }