@Test
public void shouldProperlyMapNetworkAddressCollectionIntoNetworkAddressModelCollection()
    throws Exception {

  NetworkAddress networkAddress1 = NetworkAddress.builder()
      .ip("192.168.1.45")
      .port(9999)
      .build();
  NetworkAddress networkAddress2 = NetworkAddress.builder()
      .ip("192.168.1.80")
      .port(1111)
      .build();
  ArrayList<NetworkAddress> networkAddresses = new ArrayList<>();
  networkAddresses.add(networkAddress1);
  networkAddresses.add(networkAddress2);
  Collection<NetworkAddressModel> networkAddressModels =
      networkAddressModelDataMapper.transform(networkAddresses);
  assertThat(networkAddressModels, notNullValue());
  assertThat(networkAddressModels.size(), is(2));
  NetworkAddressModel networkAddressModel1 =
      (NetworkAddressModel) networkAddressModels.toArray()[0];
  assertThat(networkAddressModel1, notNullValue());
  assertThat(networkAddressModel1, instanceOf(NetworkAddressModel.class));
  assertThat(networkAddressModel1.ip(), notNullValue());
  assertThat(networkAddressModel1.ip(), is("192.168.1.45"));
  assertThat(networkAddressModel1.port(), is(9999));
  NetworkAddressModel networkAddressModel2 =
      (NetworkAddressModel) networkAddressModels.toArray()[1];
  assertThat(networkAddressModel2, notNullValue());
  assertThat(networkAddressModel2, instanceOf(NetworkAddressModel.class));
  assertThat(networkAddressModel2.ip(), notNullValue());
  assertThat(networkAddressModel2.ip(), is("192.168.1.80"));
  assertThat(networkAddressModel2.port(), is(1111));
}