@Test public void getAddressesAsMailAddressShouldReturnEmptyOnEmpty() { assertThat(AddressesArrayToMailAddressListConverter.getAddressesAsMailAddress(new Address[]{})).isEmpty(); }
public static List<MailAddress> getAddressesAsMailAddress(Address[] addresses) { if (addresses == null) { return ImmutableList.of(); } return Arrays.asList(addresses) .stream() .map(address -> toMailAddress(address)) .flatMap(Optional::stream) .collect(Guavate.toImmutableList()); }
AddressesArrayToMailAddressListConverter { public static List<MailAddress> getAddressesAsMailAddress(Address[] addresses) { if (addresses == null) { return ImmutableList.of(); } return Arrays.asList(addresses) .stream() .map(address -> toMailAddress(address)) .flatMap(Optional::stream) .collect(Guavate.toImmutableList()); } }
AddressesArrayToMailAddressListConverter { public static List<MailAddress> getAddressesAsMailAddress(Address[] addresses) { if (addresses == null) { return ImmutableList.of(); } return Arrays.asList(addresses) .stream() .map(address -> toMailAddress(address)) .flatMap(Optional::stream) .collect(Guavate.toImmutableList()); }  }
AddressesArrayToMailAddressListConverter { public static List<MailAddress> getAddressesAsMailAddress(Address[] addresses) { if (addresses == null) { return ImmutableList.of(); } return Arrays.asList(addresses) .stream() .map(address -> toMailAddress(address)) .flatMap(Optional::stream) .collect(Guavate.toImmutableList()); }  static List<MailAddress> getAddressesAsMailAddress(Address[] addresses); }
AddressesArrayToMailAddressListConverter { public static List<MailAddress> getAddressesAsMailAddress(Address[] addresses) { if (addresses == null) { return ImmutableList.of(); } return Arrays.asList(addresses) .stream() .map(address -> toMailAddress(address)) .flatMap(Optional::stream) .collect(Guavate.toImmutableList()); }  static List<MailAddress> getAddressesAsMailAddress(Address[] addresses);  }