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