@Test public void testHashCode() { assertEquals(OptionalBoolean.empty().hashCode(), 0); assertEquals(1231, OptionalBoolean.of(true).hashCode()); assertEquals(1237, OptionalBoolean.of(false).hashCode()); }
@Override public int hashCode() { return isPresent ? (value ? 1231 : 1237) : 0; }
OptionalBoolean { @Override public int hashCode() { return isPresent ? (value ? 1231 : 1237) : 0; } }
OptionalBoolean { @Override public int hashCode() { return isPresent ? (value ? 1231 : 1237) : 0; } private  OptionalBoolean(); private  OptionalBoolean(boolean value); }
OptionalBoolean { @Override public int hashCode() { return isPresent ? (value ? 1231 : 1237) : 0; } private  OptionalBoolean(); private  OptionalBoolean(boolean value); @NotNull static OptionalBoolean empty(); @NotNull static OptionalBoolean of(boolean value); @NotNull static OptionalBoolean ofNullable(@Nullable Boolean value); boolean getAsBoolean(); boolean isPresent(); boolean isEmpty(); void ifPresent(@NotNull BooleanConsumer consumer); void ifPresentOrElse(@NotNull BooleanConsumer consumer, @NotNull Runnable emptyAction); @NotNull OptionalBoolean executeIfPresent(@NotNull BooleanConsumer consumer); @NotNull OptionalBoolean executeIfAbsent(@NotNull Runnable action); @Nullable R custom(@NotNull Function<OptionalBoolean, R> function); @NotNull OptionalBoolean filter(@NotNull BooleanPredicate predicate); @NotNull OptionalBoolean filterNot(@NotNull BooleanPredicate predicate); @NotNull OptionalBoolean map(@NotNull BooleanPredicate mapper); @NotNull Optional<U> mapToObj(@NotNull BooleanFunction<U> mapper); @NotNull OptionalBoolean or(@NotNull Supplier<OptionalBoolean> supplier); boolean orElse(boolean other); boolean orElseGet(@NotNull BooleanSupplier other); boolean orElseThrow(); boolean orElseThrow(@NotNull Supplier<X> exceptionSupplier); @Override boolean equals(Object obj); @Override int hashCode(); @NotNull @Override String toString(); }
OptionalBoolean { @Override public int hashCode() { return isPresent ? (value ? 1231 : 1237) : 0; } private  OptionalBoolean(); private  OptionalBoolean(boolean value); @NotNull static OptionalBoolean empty(); @NotNull static OptionalBoolean of(boolean value); @NotNull static OptionalBoolean ofNullable(@Nullable Boolean value); boolean getAsBoolean(); boolean isPresent(); boolean isEmpty(); void ifPresent(@NotNull BooleanConsumer consumer); void ifPresentOrElse(@NotNull BooleanConsumer consumer, @NotNull Runnable emptyAction); @NotNull OptionalBoolean executeIfPresent(@NotNull BooleanConsumer consumer); @NotNull OptionalBoolean executeIfAbsent(@NotNull Runnable action); @Nullable R custom(@NotNull Function<OptionalBoolean, R> function); @NotNull OptionalBoolean filter(@NotNull BooleanPredicate predicate); @NotNull OptionalBoolean filterNot(@NotNull BooleanPredicate predicate); @NotNull OptionalBoolean map(@NotNull BooleanPredicate mapper); @NotNull Optional<U> mapToObj(@NotNull BooleanFunction<U> mapper); @NotNull OptionalBoolean or(@NotNull Supplier<OptionalBoolean> supplier); boolean orElse(boolean other); boolean orElseGet(@NotNull BooleanSupplier other); boolean orElseThrow(); boolean orElseThrow(@NotNull Supplier<X> exceptionSupplier); @Override boolean equals(Object obj); @Override int hashCode(); @NotNull @Override String toString();  }