### Question:
ConstraintChecker { public void check(Text table, byte[] visibility) throws ConstraintViolationException { if (!isConfigured) { return; } Collection<VisibilityConstraint> tableConstraints = constraints.get(table); if (tableConstraints != null && !tableConstraints.isEmpty()) { for (VisibilityConstraint constraint : tableConstraints) { if (!constraint.isValid(visibility)) { throw new ConstraintViolationException(table, constraint); } } } } private  ConstraintChecker(Multimap<Text,VisibilityConstraint> constraints); static ConstraintChecker create(Configuration conf); boolean isConfigured(); void check(Text table, byte[] visibility); static final String INITIALIZERS; }### Answer:
@Test(expected = ConstraintChecker.ConstraintViolationException.class) public void shouldFailOnViolatedConstraint() { constraintChecker.check(new Text("eventTable"), emptyViz); }
@Test public void shouldPassOnNotViolatedConstraint() { constraintChecker.check(new Text("eventTable"), nonemptyViz); }
@Test public void shouldPassForNonConfiguredTable() { constraintChecker.check(new Text("indexTable"), emptyViz); }