### Question:
StaffToTeacherSchoolAssociationValidator extends AbstractContextValidator { @Override public boolean canValidate(String entityType, boolean isTransitive) { return isStaff() && EntityNames.TEACHER_SCHOOL_ASSOCIATION.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 testCanValidateStaffToTeacherSchoolAssociation() throws Exception { assertTrue(validator.canValidate(EntityNames.TEACHER_SCHOOL_ASSOCIATION, false)); assertTrue(validator.canValidate(EntityNames.TEACHER_SCHOOL_ASSOCIATION, true)); }
@Test public void testDeniedStaffToOtherEntities() throws Exception { assertFalse(validator.canValidate(EntityNames.STUDENT, true)); assertFalse(validator.canValidate(EntityNames.STUDENT, false)); assertFalse(validator.canValidate(EntityNames.TEACHER, true)); assertFalse(validator.canValidate(EntityNames.TEACHER, false)); }