### Question:
Result { boolean isPresent() { return Objects.nonNull(value); } private  Result(T value, E err); static Result<T, E> of(T value); static Result<T, E> error(E err); T get(); E getErr(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void testIsPresent() { assertThat("Result of value must be present", Result.of(42).isPresent(), is(true)); assertThat("Result of error must not be present", Result.error(42).isPresent(), is(false)); }