@Test
public void shouldProperlyMapNetworkAddressModelCollectionIntoNetworkAddressCollection()
    throws Exception {

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