### Question:
RightTrimFunction implements StringFunction { public String execute(String input) { int i = input.length() - 1; while (i > 0 && Character.isWhitespace(input.charAt(i))) { i--; } return input.substring(0, i + 1); }  String execute(String input);  }### Answer:
@Test public void test_execute() { RightTrimFunction function = new RightTrimFunction(); assertEquals("zzzzzz", function.execute("zzzzzz ")); assertEquals(" ZZZZ", function.execute(" ZZZZ ")); }