### Question:
StringUtils { public String reverse(String original) { if (original == null) { throw new IllegalArgumentException("The word cannot be null"); } char[] data = original.toCharArray(); Stack<Character> stack = new Stack<>(); for (char c: data) { stack.push(c); } char[] data2 = new char[data.length]; int len = stack.size(); for (int i = 0; i < len; i++) { data2[i] = stack.pop(); } return new String(data2); }  String reverse(String original);  }### Answer:
@Test void testReverseWithNull() { when(utils.reverse(null)) .thenThrow(new IllegalArgumentException()); assertThrows(IllegalArgumentException.class, () -> utils.reverse(null)); }
@Test void testReverse() { when(utils.reverse("falcon")) .thenReturn("noclaf"); assertEquals(utils.reverse("falcon"), "noclaf"); }