### Question:
StringUtil { public static String[] appendToAll(String append, String[] appendTo) { if (append == null) { throw new IllegalArgumentException("Method argument append must not be null."); } if (appendTo == null) { throw new IllegalArgumentException("Method argument to must not be null."); } String[] result = new String[appendTo.length]; for (int i = 0; i < appendTo.length; ++i) { result[i] = appendTo[i] == null ? null : appendTo[i] + append; } return result; } private  StringUtil(); static String[] appendToAll(String append, String[] appendTo);  }### Answer:
@Test(expected = IllegalArgumentException.class) public void testNullValueForAppend() { appendToAll(null, new String[]{}); }
@Test(expected = IllegalArgumentException.class) public void testNullValueForAppendTo() { appendToAll("", null); }
@Test public void testNullValuesInAppendToRemainNull() { assertThat(appendToAll("", new String[]{null, null})) .containsOnly(null, null); }
@Test public void testAppending() { assertThat(appendToAll("/test", new String[]{"/one", "", "/two"})) .isEqualTo(new String[]{"/one/test", "/test", "/two/test"}); }