### Question:
StringUtils { public static boolean isNullOrWhitespace(final String str) { if (isNullOrEmpty(str)) { return true; } for (int i = 0; i < str.length(); i++) { if (!Character.isWhitespace(str.charAt(i))) { return false; } } return true; } private  StringUtils(); static boolean isNullOrEmpty(final String str); static boolean isNullOrWhitespace(final String str); static String replaceVariable(final String string, final String name, final String value); static boolean equalsIgnoreCase(
      Optional<String> optionalString1, Optional<String> optionalString2);  }### Answer:
@Test public void isNullOrWhitespaceReturnsCorrectResult() { MatcherAssert.assertThat(StringUtils.isNullOrWhitespace(null), IsEqual.equalTo(true)); MatcherAssert.assertThat(StringUtils.isNullOrWhitespace(""), IsEqual.equalTo(true)); MatcherAssert.assertThat(StringUtils.isNullOrWhitespace(" "), IsEqual.equalTo(true)); MatcherAssert.assertThat(StringUtils.isNullOrWhitespace(" \t \t"), IsEqual.equalTo(true)); MatcherAssert.assertThat(StringUtils.isNullOrWhitespace("foo"), IsEqual.equalTo(false)); MatcherAssert.assertThat(StringUtils.isNullOrWhitespace(" foo "), IsEqual.equalTo(false)); }