class RecoveryCodeGenerator {

    public String[] generateDelimitedCodesWithSpecifics(int numCodes, CodeGeneratorSource alphabet,
                                                        char delimiter, Map<Integer, Character> specifics,
                                                        boolean allowDuplicates, int... groups) throws CodeException {
        Reject.ifTrue(numCodes < 1);

        String[] recoveryCodes = new String[numCodes];
        String result;

        for (int i = 0; i < numCodes; i++) {

            int counter = 0;

            do {
                result = generateDelimitedCodeWithSpecifics(alphabet, delimiter, specifics, groups);
            } while (!allowDuplicates
                    && Arrays.asList(recoveryCodes).contains(result)
                    && counter++ <= retryMaximum);

            if (counter >= retryMaximum) {
                throw new CodeException("Unable to generate unique codes with the given constraints.");
            }

            recoveryCodes[i] = result;
        }

        return recoveryCodes;
    }

    public  RecoveryCodeGenerator(SecureRandom secureRandom, int retryMaximum);
    @Inject public  RecoveryCodeGenerator(SecureRandom secureRandom);

}