MutationOrderValidator implements Validator<Mutation<?>> { @Override public void reset() { lastSeenId.set(-1); }  @Override void validate(@NonNull final Mutation<?> mutation); @Override void reset();  }
@Test public void testReset() throws Exception { List<Mutation> unorderedMutations = Lists.newArrayList(); when(firstMetadata.getId()).thenReturn(1L); when(secondMetadata.getId()).thenReturn(2L); MutationOrderValidator validator = new MutationOrderValidator(unorderedMutations::add); validator.validate(firstMutation); validator.validate(secondMutation); validator.reset(); validator.validate(firstMutation); validator.validate(secondMutation); assertTrue(unorderedMutations.isEmpty()); }