use of org.eclipse.collections.impl.block.factory.Functions2 in project eclipse-collections by eclipse.
the class Functions2Test method throwingWithUserSpecifiedException.
@Test
public void throwingWithUserSpecifiedException() {
Verify.assertThrowsWithCause(RuntimeException.class, IOException.class, () -> {
Functions2.throwing((one, two) -> {
throw new IOException();
}, (one, two, ce) -> new RuntimeException(ce)).value(null, null);
});
Verify.assertThrowsWithCause(MyRuntimeException.class, IOException.class, () -> {
Functions2.throwing((one, two) -> {
throw new IOException();
}, this::throwMyException).value(null, null);
});
Verify.assertThrows(NullPointerException.class, () -> {
Functions2.throwing((one, two) -> {
throw new NullPointerException();
}, this::throwMyException).value(null, null);
});
}
Aggregations