### Question:
Validator { public boolean isEmail(String input, boolean canBeNull) { return is(input, canBeNull, email); } Validator(); void checkPlayerId(String input); boolean isReadableName(String input); boolean isNickName(String input); boolean isFullName(String input); void checkPlayerId(String input, boolean canBeNull); boolean isPlayerId(String input, boolean canBeNull); boolean isEmail(String input, boolean canBeNull); void checkEmail(String input, boolean canBeNull); boolean isCode(String input, boolean canBeNull); void checkCode(String input, boolean canBeNull); boolean isEmpty(String input); boolean isGameName(String input, boolean canBeNull); boolean isRoomName(String input, boolean canBeNull); boolean is(String input, boolean canBeNull, Pattern pattern); void checkRoomName(String input, boolean canBeNull); void checkGameName(String input, boolean canBeNull); void checkNotEmpty(String name, String input); GameType checkGameType(String input); void checkMD5(String input); void checkCommand(String input); void checkPlayerCode(String id, String code); void checkNotNull(String name, Object input); void checkPlayerInRoom(String id, String roomName); static final boolean CAN_BE_NULL; static final boolean CANT_BE_NULL; }### Answer:
@Test public void validateIsEmail() { assertFalse(validator.isEmail(null, CANT_BE_NULL)); assertTrue(validator.isEmail(null, CAN_BE_NULL)); assertFalse(validator.isEmail("null", CANT_BE_NULL)); assertTrue(validator.isEmail("null", CAN_BE_NULL)); assertFalse(validator.isEmail("", CANT_BE_NULL)); assertTrue(validator.isEmail("", CAN_BE_NULL)); assertFalse(validator.isEmail("NuLL", CANT_BE_NULL)); assertTrue(validator.isEmail("NuLL", CAN_BE_NULL)); assertFalse(validator.isEmail("NULL", CANT_BE_NULL)); assertTrue(validator.isEmail("NULL", CAN_BE_NULL)); assertFalse(validator.isEmail("*F(@DF^@(&@DF(@^", CANT_BE_NULL)); assertFalse(validator.isEmail("too large aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", CANT_BE_NULL)); assertTrue(validator.isEmail("qwe@asd.com", CANT_BE_NULL)); assertFalse(validator.isEmail("someId", CANT_BE_NULL)); }