@Test public void testClosestToLowerBoundNotInArray() { try { SpikeInterpolation.getLowerBound(useAr, -3); fail("IllegalArgumentException expected"); } catch (IllegalArgumentException expected) { } }
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; }
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; } }
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; }  }
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; }   }
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; }    }