### Question:
Validator { public void checkNotEmpty(String name, String input) { if (isEmpty(input)) { throw new IllegalArgumentException(String.format("Parameter %s is empty: '%s'", name, input)); } } 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 validateCheckNotEmpty() { shouldError("Parameter name is empty: 'Null'", () -> validator.checkNotEmpty("name", "Null")); shouldError("Parameter name is empty: 'null'", () -> validator.checkNotEmpty("name", null)); shouldError("Parameter name is empty: 'NULL'", () -> validator.checkNotEmpty("name", "NULL")); shouldError("Parameter name is empty: 'null'", () -> validator.checkNotEmpty("name", "null")); shouldError("Parameter name is empty: ''", () -> validator.checkNotEmpty("name", "")); shouldOk(() -> validator.checkNotEmpty("name", "not-empty")); }