AddressUtils { @Nonnull public static String formatStreetWithHouseNumber( @Nonnull final Locale locale, @Nonnull final String street, @Nullable final Integer houseNumber, @Nullable final String houseNumberPostfix) { assert street != null; final String fullNumber = ((houseNumber == null) ? "" : houseNumber) + (((houseNumberPostfix == null) || houseNumberPostfix.isEmpty()) ? "" : (((houseNumber == null) ? "" : '-') + houseNumberPostfix)); final String result; if (fullNumber.isEmpty()) { result = street; } else { if (isEnglish(locale)) { result = fullNumber + ' ' + street; } else { result = street + ' ' + fullNumber; } } return result; } private  AddressUtils(); static boolean isValidCountryISO2(@Nullable final String countryCode); @Nonnull static String getDisplayCountry(@Nonnull final String countryISO2); @Nonnull static String getDisplayCountry(@Nonnull final String countryISO2, @Nonnull final Locale language); @Nonnull static String formatStreetWithHouseNumber(
            @Nonnull final Locale locale,
            @Nonnull final String street,
            @Nullable final Integer houseNumber,
            @Nullable final String houseNumberPostfix); @Nonnull static String formatPostcalCodeAndCity(
            @Nonnull final Locale locale,
            @Nonnull final String postalCode,
            @Nonnull final String city);  }
@Test public void testFormatStreetWithHouseNumber() { LOG.info("testFormatStreetWithHouseNumber"); final Locale nl = new Locale("nl", "NL"); final Locale e1 = new Locale("en", "UK"); final Locale e2 = Locale.ENGLISH; Assert.assertEquals("s", AddressUtils.formatStreetWithHouseNumber(nl, "s", null, null)); Assert.assertEquals("s", AddressUtils.formatStreetWithHouseNumber(e1, "s", null, null)); Assert.assertEquals("s", AddressUtils.formatStreetWithHouseNumber(e2, "s", null, null)); Assert.assertEquals("s 1", AddressUtils.formatStreetWithHouseNumber(nl, "s", 1, null)); Assert.assertEquals("1 s", AddressUtils.formatStreetWithHouseNumber(e1, "s", 1, null)); Assert.assertEquals("1 s", AddressUtils.formatStreetWithHouseNumber(e2, "s", 1, null)); Assert.assertEquals("s a", AddressUtils.formatStreetWithHouseNumber(nl, "s", null, "a")); Assert.assertEquals("a s", AddressUtils.formatStreetWithHouseNumber(e1, "s", null, "a")); Assert.assertEquals("a s", AddressUtils.formatStreetWithHouseNumber(e2, "s", null, "a")); Assert.assertEquals("s 1-a", AddressUtils.formatStreetWithHouseNumber(nl, "s", 1, "a")); Assert.assertEquals("1-a s", AddressUtils.formatStreetWithHouseNumber(e1, "s", 1, "a")); Assert.assertEquals("1-a s", AddressUtils.formatStreetWithHouseNumber(e2, "s", 1, "a")); }