### Question:
Enforcer { public List<T> unexpected() { return Collections.unmodifiableList( existing.get() .stream() .filter(e -> this.configured.stream().noneMatch(c -> isEqual.test(c, e))) .collect(Collectors.toList())); } protected  Enforcer(Collection<T> configured, Supplier<Collection<T>> existing, BiPredicate<T, T> isEqual, boolean safemode); List<T> absent(); List<T> unexpected(); void createAbsent(); void deleteUnexpected(); void enforceAll(); void stats();  }### Answer:
@Test public void testNoUnexpected() { enforcer = new DummyEnforcer(dummies, () -> dummies); Assert.assertTrue(enforcer.unexpected().isEmpty()); }
@Test public void testUnexpected() { Dummy unexpected = new Dummy("x", emptyMap()); enforcer = new DummyEnforcer(dummies, () -> singletonList(unexpected)); Assert.assertEquals(1, enforcer.unexpected().size()); Assert.assertEquals(unexpected, enforcer.unexpected().get(0)); }