static String prettifyException(Exception e) {
    if (e.getLocalizedMessage() != null) {
      return e.getClass().getSimpleName() + ": "
          + e.getLocalizedMessage().split("\n")[0];
    } else if (e.getStackTrace() != null && e.getStackTrace().length > 0) {
      return e.getClass().getSimpleName() + " at " + e.getStackTrace()[0];
    } else {
      return e.getClass().getSimpleName();
    }
  }
@Test
  public void prettifyException() {

    String pretty = AdminHelper.prettifyException(
        new IllegalArgumentException("Something is wrong",
            new IllegalArgumentException("Something is illegal")));

    Assert.assertEquals(
        "IllegalArgumentException: Something is wrong",
        pretty);

  }