### Question:
NINumberGenerator implements Generator<String> { @Override public String next() { String start = beginning.next(); if (start.matches("^(?!BG)(?!GB)(?!NK)(?!KN)(?!TN)(?!NT)(?!ZZ)(?:[A-CEGHJ-PR-TW-Z][A-CEGHJ-NPR-TW-Z])")) { return String.format("%s%06d%s", start.toUpperCase(), RDG.integer(999999).next(), end.next()); } return next(); }  @Override String next();  }### Answer:
@Test public void generateNINumbers(){ Generator<String> generator = RDG.niNumber(); for (int i = 0; i < 1000; i++) { String niNumber = generator.next(); print(niNumber); assertThat(niNumberPattern.matcher(niNumber).matches()).isTrue(); } }