public static String nullToEmpty(@Nullable String string) {
    return string == null ? "" : string;
  }
@Test
  public void testStringNullToEmpty() {
    String str = "This is a test";
    assertEquals(str, StringUtils.nullToEmpty(str));
    assertEquals("", StringUtils.nullToEmpty(null));
  }