@Test public void simpleNoException() throws Exception { ExceptionUtil.perform(Exception.class, () -> { }); ExceptionUtil.perform(Exception.class, () -> null); ExceptionUtil.perform(Exception.class, "Not to be thrown.", () -> null); }
public static <E extends Exception> void perform(Class<E> cls, PerformAction action) throws E { try { action.action(); } catch (Exception e) { throw prepareException(cls, e.getMessage(), e); } }
ExceptionUtil { public static <E extends Exception> void perform(Class<E> cls, PerformAction action) throws E { try { action.action(); } catch (Exception e) { throw prepareException(cls, e.getMessage(), e); } } }
ExceptionUtil { public static <E extends Exception> void perform(Class<E> cls, PerformAction action) throws E { try { action.action(); } catch (Exception e) { throw prepareException(cls, e.getMessage(), e); } }  }
ExceptionUtil { public static <E extends Exception> void perform(Class<E> cls, PerformAction action) throws E { try { action.action(); } catch (Exception e) { throw prepareException(cls, e.getMessage(), e); } }  static void perform(Class<E> cls, PerformAction action); static T perform(Class<E> cls, PerformResult<T> action); static T perform(Class<E> cls, String message, PerformResult<T> action); }
ExceptionUtil { public static <E extends Exception> void perform(Class<E> cls, PerformAction action) throws E { try { action.action(); } catch (Exception e) { throw prepareException(cls, e.getMessage(), e); } }  static void perform(Class<E> cls, PerformAction action); static T perform(Class<E> cls, PerformResult<T> action); static T perform(Class<E> cls, String message, PerformResult<T> action);  }