// Path: src/main/java/com/hadisatrio/optional/function/Function.java
// public interface Function {
// 
//     void call();
// }
// 
// Path: src/main/java/com/hadisatrio/optional/function/IntConsumer.java
// public interface IntConsumer {
// 
//     void consume(int value);
// }
// 
// Path: src/main/java/com/hadisatrio/optional/function/IntSupplier.java
// public interface IntSupplier {
// 
//     int get();
// }
// 
// Path: src/main/java/com/hadisatrio/optional/function/Supplier.java
// public interface Supplier<T> {
// 
//     T get();
// }


import com.hadisatrio.optional.function.Function;
import com.hadisatrio.optional.function.IntConsumer;
import com.hadisatrio.optional.function.IntSupplier;
import com.hadisatrio.optional.function.Supplier;
import java.io.Serializable;
     * <li>the present values are "equal to" each other via the "{@code ==}"
     * operator.
     * </ul>
     *
     * @param object an object to be tested for equality
     * @return {code true} if the other object is "equal to" this object
     * otherwise {@code false}
     */
    @Override
    public boolean equals(Object object) {
        if (this == object) {
            return true;
        }

        if (!(object instanceof OptionalInt)) {
            return false;
        }

        final OptionalInt other = (OptionalInt) object;
        return (isPresent() && other.isPresent())
                ? get() == other.get()
                : isPresent() == other.isPresent();
    }

    /**
     * If a value is present, invoke the specified consumer with the value,
     * otherwise do nothing.
     *
     * @param consumer block to be executed if a value is present
     */
// Path: src/main/java/com/hadisatrio/optional/function/Function.java
// public interface Function {
// 
//     void call();
// }
// 
// Path: src/main/java/com/hadisatrio/optional/function/IntConsumer.java
// public interface IntConsumer {
// 
//     void consume(int value);
// }
// 
// Path: src/main/java/com/hadisatrio/optional/function/IntSupplier.java
// public interface IntSupplier {
// 
//     int get();
// }
// 
// Path: src/main/java/com/hadisatrio/optional/function/Supplier.java
// public interface Supplier<T> {
// 
//     T get();
// }


// Path: src/main/java/com/hadisatrio/optional/OptionalInt.java
import com.hadisatrio.optional.function.Function;
import com.hadisatrio.optional.function.IntConsumer;
import com.hadisatrio.optional.function.IntSupplier;
import com.hadisatrio.optional.function.Supplier;
import java.io.Serializable;

     * <li>the present values are "equal to" each other via the "{@code ==}"
     * operator.
     * </ul>
     *
     * @param object an object to be tested for equality
     * @return {code true} if the other object is "equal to" this object
     * otherwise {@code false}
     */
    @Override
    public boolean equals(Object object) {
        if (this == object) {
            return true;
        }

        if (!(object instanceof OptionalInt)) {
            return false;
        }

        final OptionalInt other = (OptionalInt) object;
        return (isPresent() && other.isPresent())
                ? get() == other.get()
                : isPresent() == other.isPresent();
    }

    /**
     * If a value is present, invoke the specified consumer with the value,
     * otherwise do nothing.
     *
     * @param consumer block to be executed if a value is present
     */
    public void ifPresent(IntConsumer consumer) {