### Question:
SimpleCredentialGenerator implements CredentialGenerator { @Override public Mono<String> generateString(String applicationId, String serviceInstanceId, String descriptor, int length, boolean includeUppercaseAlpha, boolean includeLowercaseAlpha, boolean includeNumeric, boolean includeSpecial) { StringBuilder builder = new StringBuilder(); if (includeUppercaseAlpha) { builder.append(UPPERCASE_ALPHA); } if (includeLowercaseAlpha) { builder.append(LOWERCASE_ALPHA); } if (includeNumeric) { builder.append(DIGITS); } if (includeSpecial) { builder.append(SPECIAL_CHARACTERS); } if (builder.length() == 0) { builder.append(UPPERCASE_ALPHA) .append(LOWERCASE_ALPHA) .append(DIGITS) .append(SPECIAL_CHARACTERS); } char[] chars = builder.toString().toCharArray(); return Mono.just(RandomStringUtils.random(length, 0, chars.length - 1, false, false, chars, secureRandom)); }  @Override Mono<Tuple2<String, String>> generateUser(String applicationId, String serviceInstanceId, String descriptor,
		int length,
		boolean includeUppercaseAlpha, boolean includeLowercaseAlpha,
		boolean includeNumeric, boolean includeSpecial); @Override Mono<String> generateString(String applicationId, String serviceInstanceId, String descriptor, int length,
		boolean includeUppercaseAlpha, boolean includeLowercaseAlpha,
		boolean includeNumeric, boolean includeSpecial);  }### Answer:
@Test void generateString() { SimpleCredentialGenerator generator = new SimpleCredentialGenerator(); StepVerifier.create(generator.generateString(null, null, null, 12, true, false, false, false)) .assertNext(s -> assertThat(s).matches("^[A-Z]{12}$")) .verifyComplete(); StepVerifier.create(generator.generateString(null, null, null, 12, false, true, false, false)) .assertNext(s -> assertThat(s).matches("^[a-z]{12}$")) .verifyComplete(); StepVerifier.create(generator.generateString(null, null, null, 12, false, false, true, false)) .assertNext(s -> assertThat(s).matches("^[0-9]{12}$")) .verifyComplete(); StepVerifier.create(generator.generateString(null, null, null, 12, false, false, false, true)) .assertNext(s -> assertThat(s).matches("^[\\p{Punct}]{12}$")) .verifyComplete(); StepVerifier.create(generator.generateString(null, null, null, 12, true, true, true, true)) .assertNext(s -> assertThat(s).matches("^[a-zA-Z0-9\\p{Punct}]{12}$")) .verifyComplete(); StepVerifier.create(generator.generateString(null, null, null, 12, false, false, false, false)) .assertNext(s -> assertThat(s).matches("^[a-zA-Z0-9\\p{Punct}]{12}$")) .verifyComplete(); }