### Question:
Optional { @NonNull public static <T> Optional<T> of(@Nullable T value) { return value == null ? (Optional<T>) EMPTY : new Optional<T>(value); } private  Optional(@Nullable T value); @NonNull static Optional<T> empty(); @NonNull static Optional<T> of(@Nullable T value); @NonNull T get(); boolean isPresent(); @NonNull T or(@NonNull T defaultValue); @Nullable T orNull(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void ofNotNullValueReturnsEqualInstances() { assertThat(Optional.of("some value")) .isEqualTo(Optional.of("some value")); }
@Test public void verifyEqualsAndHashCodeImplementation() { EqualsVerifier .forClass(Optional.class) .allFieldsShouldBeUsed() .withPrefabValues(Optional.class, Optional.of("some value"), Optional.of("another value")) .verify(); }