Result { public Result<V, E> orElse(Function<E, Result<V, E>> orElse) { return isOk() ? this : orElse.apply(error); } private  Result(@Nullable V value, @Nullable E error); boolean isOk(); boolean isErr(); V get(); E getError(); Result<R, E> map(Function<V, R> function); Result<R, E> flatMap(Function<V, Result<R, E>> function); Result<V, E> orElse(Function<E, Result<V, E>> orElse); V orElseGet(Function<E, V> orElse); V orElseThrow(ThrowingFunction<E, T, T> consumer); Result<V, E> peek(Consumer<V> consumer); Result<V, E> onError(Consumer<E> consumer); static Result<V, E> ok(V value); static Result<V, E> error(E err);  }
@Test void orElse() { assertEquals(7, Result.error(-1).orElse(err -> Result.ok(7)).get()); }