ThrowableUtils { public static void changeThrowableMessage(Throwable throwable, Function<String, String> messageChangeFunc) { changeThrowableMessage(throwable, messageChangeFunc.apply(throwable.getMessage())); }  static void changeThrowableMessage(Throwable throwable, Function<String, String> messageChangeFunc); static void changeThrowableMessage(Throwable throwable, String message);  }
@Test void test() { try { checkArgument(false, "myTest"); } catch (IllegalArgumentException e) { changeThrowableMessage(e, it -> it + "!!!"); assertEquals("myTest!!!", e.getMessage()); } }