### Question:
StellaStringUtils { public static String suffixNotNullStringOrDefault (String str, String defaultStr, String suffix) { if ( str == null) { return defaultStr; } return str + suffix; }  static String leftPadWithZeros(String input, int expectedSize); static String prefixNotNullStringOrDefault(String str, String defaultStr, String prefix); static String suffixNotNullStringOrDefault(String str, String defaultStr, String suffix);  }### Answer:
@Test public void deveRetornarUmaStringPreenchidaAoInvesDeNullSemSufixo() throws Exception { String value = null; String substitute = "123"; String result = StellaStringUtils.suffixNotNullStringOrDefault(value, substitute, "123"); assertThat(result, notNullValue()); assertThat(result, is(substitute)); }
@Test public void naoDeveRetornarUmaStringSubstitutaQuandoValorNaoEstiverNuloComSufixo() throws Exception { String value = "abc"; String substitute = "123"; String result = StellaStringUtils.suffixNotNullStringOrDefault(value, substitute, "def"); assertThat(result, is(value+"def")); }