### Question:
AutoConfigSharesValidValidatorImpl implements AutoConfigSharesValidValidator { @Override public boolean isValid(Collection<?> list, ConstraintValidatorContext context) { if (list == null) { return true; } boolean test = false; int total = 0; for (Object o : list) { if (o instanceof MemoryParameter) { MemoryParameter memory = (MemoryParameter) o; Integer share = memory.getAutoConfigShare(); if (share != null) { total += share; test = true; } } } if (test && total != 100) { addViolation(context); return false; } return true; }  @Override void initialize(AutoConfigSharesValid constraintAnnotation); @Override boolean isValid(Collection<?> list, ConstraintValidatorContext context);  }### Answer:
@Test public void testSatisfied() { assertTrue(validator.isValid(ImmutableSet.of(mp1, mp2, mp3, p1, p2), context)); }
@Test public void testTooLittle() { assertFalse(validator.isValid(ImmutableSet.of(mp1, mp2, p1, p2), context)); }
@SuppressWarnings("unchecked") @Test public void testTooMuch() { assertFalse(validator.isValid(ImmutableSet.of(mp1, mp2, mp3, mp4, p1, p2), context)); }