### Question:
GenericToEdOrgValidator extends AbstractContextValidator { @Override public boolean canValidate(String entityType, boolean isTransitive) { if (EntityNames.SCHOOL.equals(entityType) || EntityNames.EDUCATION_ORGANIZATION.equals(entityType)) { if (isStudentOrParent()) { return !isTransitive; } return true; } return false; }  @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.SCHOOL, false)); assertTrue(validator.canValidate(EntityNames.SCHOOL, true)); assertTrue(validator.canValidate(EntityNames.EDUCATION_ORGANIZATION, false)); assertTrue(validator.canValidate(EntityNames.EDUCATION_ORGANIZATION, true)); }
@Test public void testCanNotValidate() { assertFalse(validator.canValidate(EntityNames.ATTENDANCE, true)); assertFalse(validator.canValidate(EntityNames.ATTENDANCE, false)); assertFalse(validator.canValidate(EntityNames.SECTION, true)); assertFalse(validator.canValidate(EntityNames.SECTION, false)); }