### Question:
RecoveryCodeGenerator { public String generateDelimitedCode(CodeGeneratorSource alphabet, char delimiter, int... groups) { Reject.ifNull(groups); Reject.ifTrue(groups.length < 1); Reject.ifNull(delimiter); StringBuilder codeBuilder = new StringBuilder(); for (int group : groups) { Reject.ifTrue(group < 1); if (codeBuilder.length() > 0) { codeBuilder.append(delimiter); } codeBuilder.append(generateCode(alphabet, group)); } return codeBuilder.toString(); } RecoveryCodeGenerator(SecureRandom secureRandom, int retryMaximum); @Inject  RecoveryCodeGenerator(SecureRandom secureRandom); String generateCode(CodeGeneratorSource alphabet, int length); String generateDelimitedCode(CodeGeneratorSource alphabet, char delimiter, int... groups); String generateDelimitedCodeWithSpecifics(CodeGeneratorSource alphabet, char delimiter,
                                                       Map<Integer, Character> specifics, int... groups); String[] generateCodes(int numCodes, CodeGeneratorSource alphabet, boolean allowDuplicates); String[] generateCodes(int numCodes, CodeGeneratorSource alphabet, int length, boolean allowDuplicates); String[] generateDelimitedCodes(int numCodes, CodeGeneratorSource alphabet,
                                           char delimiter, boolean allowDuplicates, int... groups); String[] generateDelimitedCodesWithSpecifics(int numCodes, CodeGeneratorSource alphabet,
                                                        char delimiter, Map<Integer, Character> specifics,
                                                        boolean allowDuplicates, int... groups); final static int DEFAULT_LENGTH; final static int DEFAULT_RETRIES; }### Answer:
@Test (expectedExceptions = NullPointerException.class) public void shouldErrorNullAlphabet5() throws CodeException { recoveryCodeGenerator.generateDelimitedCode(null, '-', 1); }
@Test (expectedExceptions = IllegalArgumentException.class) public void shouldErrorNullGroups3() throws CodeException { recoveryCodeGenerator.generateDelimitedCode( new TestAlphabet(), '-'); }
@Test (expectedExceptions = IllegalArgumentException.class) public void shouldErrorGroupsUndefined2() throws CodeException { recoveryCodeGenerator.generateDelimitedCode( new TestAlphabet(), '-'); }
@Test (expectedExceptions = IllegalArgumentException.class) public void shouldErrorGroupTooSmall3() throws CodeException { recoveryCodeGenerator.generateDelimitedCode( new TestAlphabet(), '-', 1, 0); }