### Question:
TeacherToGradeValidator extends AbstractContextValidator { @Override public boolean canValidate(String entityType, boolean isTransitive) { return isTeacher() && EntityNames.GRADE.equals(entityType); }  @Override boolean canValidate(String entityType, boolean isTransitive); @Override Set<String> validate(String entityType, Set<String> ids); @Override SecurityUtil.UserContext getContext();  }### Answer:
@Test public void testCanValidate() { assertTrue(validator.canValidate(EntityNames.GRADE, true)); assertTrue(validator.canValidate(EntityNames.GRADE, false)); assertFalse(validator.canValidate(EntityNames.ATTENDANCE, false)); }