class Validator {

    public void checkCode(String input, boolean canBeNull) {
        if (!isCode(input, canBeNull)) {
            throw new IllegalArgumentException(String.format("Player code is invalid: '%s'", input));
        }
    }

    public  Validator();

}