@Test
public void shouldProperlyMapNetworkAddressEntityCollectionIntoNetworkAddressCollection()
    throws Exception {

  NetworkAddressEntity networkAddressEntity1 = NetworkAddressEntity.builder()
      .ip("192.168.1.1")
      .port(8889)
      .build();
  NetworkAddressEntity networkAddressEntity2 = NetworkAddressEntity.builder()
      .ip("192.168.1.2")
      .port(8890)
      .build();
  ArrayList<NetworkAddressEntity> networkAddressEntities = new ArrayList<>();
  networkAddressEntities.add(networkAddressEntity1);
  networkAddressEntities.add(networkAddressEntity2);
  Collection<NetworkAddress> networkAddresses =
      networkAddressEntityDataMapper.transform(networkAddressEntities);
  assertThat(networkAddresses, notNullValue());
  assertThat(networkAddressEntities.size(), is(2));
  NetworkAddress networkAddress1 = (NetworkAddress) networkAddresses.toArray()[0];
  assertThat(networkAddress1, notNullValue());
  assertThat(networkAddress1.ip(), is("192.168.1.1"));
  assertThat(networkAddress1.port(), is(8889));
  NetworkAddress networkAddress2 = (NetworkAddress) networkAddresses.toArray()[1];
  assertThat(networkAddress2, notNullValue());
  assertThat(networkAddress2.ip(), is("192.168.1.2"));
  assertThat(networkAddress2.port(), is(8890));
}