public static String trim(String str) {
        return str == null ? null : str.trim();
    }
@Test
  public void testTrim() {
    Assert.assertNull(StringUtil.trim(null));
    Assert.assertEquals("", StringUtil.trim(""));
    Assert.assertEquals("foo", StringUtil.trim("foo  "));
  }