public static String createStartupShutdownMessage(String classname,
      String hostname, String[] args) {
    return toStartupShutdownString("STARTUP_MSG: ", new String[] {
        "Starting " + classname,
        "  host = " + hostname,
        "  args = " + (args != null ? Arrays.asList(args) : new ArrayList<>()),
        "  version = " + VersionInfo.getVersion(),
        "  classpath = " + System.getProperty("java.class.path"),
        "  build = " + VersionInfo.getUrl() + " -r "
                     + VersionInfo.getRevision()  
                     + "; compiled by '" + VersionInfo.getUser()
                     + "' on " + VersionInfo.getDate(),
        "  java = " + System.getProperty("java.version") }
    );
  }
@Test
  public void testCreateStartupShutdownMessage() {
    //pass null args and method must still return a string beginning with
    // "STARTUP_MSG"
    String msg = StringUtils.createStartupShutdownMessage(
        this.getClass().getName(), "test.host", null);
    assertTrue(msg.startsWith("STARTUP_MSG:"));
  }