class SpikeInterpolation {

    static double getLowerBound(double[] doubles, double val) {
        double xMin = Double.MAX_VALUE;

        for (double current : doubles) {
            xMin = current <= val ? current : xMin;
        }
        if (xMin > val) {
            throw new IllegalArgumentException("Can't find the closest min value of " + val);
        }

        return xMin;
    }

}