@Test
public void throwExceptionOrError() {

    try {
        ExceptionUtil.throwExceptionOrError(new Exception("test"));
        fail();
    } catch (Exception e) {
        assertEquals("test", e.getMessage());
    }
    try {
        ExceptionUtil.throwExceptionOrError(new RuntimeException("test"));
        fail();
    } catch (RuntimeException e) {
        assertEquals("test", e.getMessage());
    } catch (Exception e) {
        fail();
    }
    try {
        ExceptionUtil.throwExceptionOrError(new Error("test"));
        fail();
    } catch (Error e) {
        assertEquals("test", e.getMessage());
    } catch (Exception e) {
        fail();
    }
}