### Question:
IPv6Generator implements Generator<String> { @Override public String next() { return format(IP_ADDRESS_FORMAT, generateGroup(), generateGroup(), generateGroup(), generateGroup(), generateGroup(), generateGroup(), generateGroup(), generateGroup()); } IPv6Generator();  IPv6Generator(Generator<Integer> delegate); @Override String next();  }### Answer:
@Test public void shouldReturnAnIPAddressWithValidOctets() { Generator<String> generator = new IPv6Generator(); for (int i = 0; i < 100; i++) { String ipAddress = generator.next(); assertThatHasValidHexDigitsInGroups(ipAddress); } }
@Test public void shouldReturnAnIPAddressUsingTheDelegateOctetGenerator() { Generator<String> generator = new IPv6Generator(new CyclicGenerator<>(10)); for (int i = 0; i < 100; i++) { String ipAddress = generator.next(); assertThatHasValidHexDigitsInGroups(ipAddress); assertThat(ipAddress, is("aaaa:aaaa:aaaa:aaaa:aaaa:aaaa:aaaa:aaaa")); } }