// 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;
     * instance provided as the parameter.
     *
     * @param <X>       Type of the exception to be thrown
     * @param throwable The throwable instance to be thrown
     * @return the present value
     * @throws X                        if there is no value present
     * @throws IllegalArgumentException if {@code throwable} is null
     */
    public <X extends Throwable> int orThrow(X throwable) throws X {
        if (throwable == null) {
            throw new IllegalArgumentException("null may not be passed as an argument.");
        }

        if (isPresent()) {
            return value;
        }
        throw throwable;
    }

    /**
     * Return the contained value, if present, otherwise throw an exception
     * to be created by the provided supplier.
     *
     * @param <X>               Type of the exception to be thrown
     * @param throwableSupplier a {@code Supplier} which will return the exception to
     *                          be thrown
     * @return the present value
     * @throws X                        if there is no value present
     * @throws IllegalArgumentException if {@code throwableSupplier} is null
     */
// 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;

     * instance provided as the parameter.
     *
     * @param <X>       Type of the exception to be thrown
     * @param throwable The throwable instance to be thrown
     * @return the present value
     * @throws X                        if there is no value present
     * @throws IllegalArgumentException if {@code throwable} is null
     */
    public <X extends Throwable> int orThrow(X throwable) throws X {
        if (throwable == null) {
            throw new IllegalArgumentException("null may not be passed as an argument.");
        }

        if (isPresent()) {
            return value;
        }
        throw throwable;
    }

    /**
     * Return the contained value, if present, otherwise throw an exception
     * to be created by the provided supplier.
     *
     * @param <X>               Type of the exception to be thrown
     * @param throwableSupplier a {@code Supplier} which will return the exception to
     *                          be thrown
     * @return the present value
     * @throws X                        if there is no value present
     * @throws IllegalArgumentException if {@code throwableSupplier} is null
     */
    public <X extends Throwable> int orThrow(Supplier<? extends X> throwableSupplier) throws X {