StringUtil { public static String sameOrDefault(final String input, final String def) { if (Strings.isNullOrEmpty(input)) { return def; } return input; } private  StringUtil(); static String sameOrDefault(final String input,
                                       final String def);  }
@Test public void testSameOrDefault() { assertEquals("foo", StringUtil.sameOrDefault(null, "foo")); assertEquals("foo", StringUtil.sameOrDefault("", "foo")); assertEquals("bar", StringUtil.sameOrDefault("bar", "foo")); }