### Question:
StaffToGlobalSectionValidator extends AbstractContextValidator { @Override public boolean canValidate(String entityType, boolean isTransitive) { return EntityNames.SECTION.equals(entityType) && isStaff(); }  @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() { setContext(seaStaff, Arrays.asList(SecureRoleRightAccessImpl.SEA_ADMINISTRATOR)); assertTrue(validator.canValidate(EntityNames.SECTION, true)); assertTrue(validator.canValidate(EntityNames.SECTION, false)); assertFalse(validator.canValidate(EntityNames.ATTENDANCE, true)); assertFalse(validator.canValidate(EntityNames.ATTENDANCE, false)); }
@Test public void testCanNotValidate() { setContext(educator2, Arrays.asList(SecureRoleRightAccessImpl.EDUCATOR)); SecurityUtil.setUserContext(SecurityUtil.UserContext.TEACHER_CONTEXT); assertFalse(validator.canValidate(EntityNames.SECTION, true)); assertFalse(validator.canValidate(EntityNames.SECTION, false)); assertFalse(validator.canValidate(EntityNames.ATTENDANCE, true)); assertFalse(validator.canValidate(EntityNames.ATTENDANCE, false)); }