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


import com.hadisatrio.optional.function.ByteConsumer;
import com.hadisatrio.optional.function.ByteSupplier;
import com.hadisatrio.optional.function.Function;
import com.hadisatrio.optional.function.Supplier;
import java.io.Serializable;
    public <X extends Throwable> byte orThrow(Supplier<? extends X> throwableSupplier) throws X {
        if (throwableSupplier == null) {
            throw new IllegalArgumentException("null may not be passed as an argument.");
        }

        if (isPresent()) {
            return value;
        }
        throw throwableSupplier.get();
    }

    /**
     * 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(ByteConsumer consumer) {
        if (isPresent()) {
            consumer.consume(value);
        }
    }

    /**
     * If a value is present, invoke the specified consumer with the value,
     * otherwise invoke the function passed as the second parameter.
     *
     * @param consumer block to be executed if a value is present
     * @param function block to be executed if a value is absent
     */
// Path: src/main/java/com/hadisatrio/optional/function/ByteConsumer.java
// public interface ByteConsumer {
// 
//     void consume(byte value);
// }
// 
// Path: src/main/java/com/hadisatrio/optional/function/ByteSupplier.java
// public interface ByteSupplier {
// 
//     byte get();
// }
// 
// Path: src/main/java/com/hadisatrio/optional/function/Function.java
// public interface Function {
// 
//     void call();
// }
// 
// Path: src/main/java/com/hadisatrio/optional/function/Supplier.java
// public interface Supplier<T> {
// 
//     T get();
// }


// Path: src/main/java/com/hadisatrio/optional/OptionalByte.java
import com.hadisatrio.optional.function.ByteConsumer;
import com.hadisatrio.optional.function.ByteSupplier;
import com.hadisatrio.optional.function.Function;
import com.hadisatrio.optional.function.Supplier;
import java.io.Serializable;

    public <X extends Throwable> byte orThrow(Supplier<? extends X> throwableSupplier) throws X {
        if (throwableSupplier == null) {
            throw new IllegalArgumentException("null may not be passed as an argument.");
        }

        if (isPresent()) {
            return value;
        }
        throw throwableSupplier.get();
    }

    /**
     * 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(ByteConsumer consumer) {
        if (isPresent()) {
            consumer.consume(value);
        }
    }

    /**
     * If a value is present, invoke the specified consumer with the value,
     * otherwise invoke the function passed as the second parameter.
     *
     * @param consumer block to be executed if a value is present
     * @param function block to be executed if a value is absent
     */
    public void ifPresentOrElse(ByteConsumer consumer, Function function) {