### Question:
FunctionUtils { public static int getLowerBoundIndex(DoubleArray set, double value) { int n = set.size(); if (value < set.get(0)) { return 0; } if (value > set.get(n - 1)) { return n - 1; } int index = Arrays.binarySearch(set.toArrayUnsafe(), value); if (index >= 0) { return index; } index = -(index + 1); index--; if (value == -0. && index < n - 1 && set.get(index + 1) == 0.) { ++index; } return index; } private  FunctionUtils(); @Deprecated static double square(double x); @Deprecated static double cube(double x); static int toTensorIndex(int[] indices, int[] dimensions); static int[] fromTensorIndex(int index, int[] dimensions); static double[] unique(double[] in); static int[] unique(int[] in); static int getLowerBoundIndex(DoubleArray set, double value);  }### Answer:
@Test public void getLowerBoundIndexTest() { int i = FunctionUtils.getLowerBoundIndex(DoubleArray.of(-2., -1.), -0.); assertThat(i).isEqualTo(1); i = FunctionUtils.getLowerBoundIndex(DoubleArray.of(1., 2.), -0.); assertThat(i).isEqualTo(0); i = FunctionUtils.getLowerBoundIndex(DoubleArray.of(1., 2., 3.), 2.5); assertThat(i).isEqualTo(1); i = FunctionUtils.getLowerBoundIndex(DoubleArray.of(1., 2., 3.), 2.); assertThat(i).isEqualTo(1); i = FunctionUtils.getLowerBoundIndex(DoubleArray.of(1., 2., 3.), -2.); assertThat(i).isEqualTo(0); i = FunctionUtils.getLowerBoundIndex(DoubleArray.of(-2., -1., 0.), -0.); assertThat(i).isEqualTo(2); i = FunctionUtils.getLowerBoundIndex(DoubleArray.of(-2., -1., 0.), 0.); assertThat(i).isEqualTo(2); i = FunctionUtils.getLowerBoundIndex(DoubleArray.of(-2., -1., 0.), -0.); assertThat(i).isEqualTo(2); i = FunctionUtils.getLowerBoundIndex(DoubleArray.of(-2., -1., -0.), -0.); assertThat(i).isEqualTo(2); i = FunctionUtils.getLowerBoundIndex(DoubleArray.of(-1., 0., 1.), -0.); assertThat(i).isEqualTo(1); i = FunctionUtils.getLowerBoundIndex(DoubleArray.of(-1., 0., 1.), 0.); assertThat(i).isEqualTo(1); i = FunctionUtils.getLowerBoundIndex(DoubleArray.of(-1., -0., 1.), 0.); assertThat(i).isEqualTo(1); i = FunctionUtils.getLowerBoundIndex(DoubleArray.of(-1., -0., 1.), -0.); assertThat(i).isEqualTo(1); i = FunctionUtils.getLowerBoundIndex(DoubleArray.of(0., 1., 2.), -0.); assertThat(i).isEqualTo(0); i = FunctionUtils.getLowerBoundIndex(DoubleArray.of(0., 1., 2.), 0.); assertThat(i).isEqualTo(0); i = FunctionUtils.getLowerBoundIndex(DoubleArray.of(-0., 1., 2.), 0.); assertThat(i).isEqualTo(0); i = FunctionUtils.getLowerBoundIndex(DoubleArray.of(-0., 1., 2.), -0.); assertThat(i).isEqualTo(0); }