### Question:
RegularAxisImpl extends AbstractReferenceableAxis<Double> implements RegularAxis, Serializable { @Override public int findIndexOf(Double position) { if (position == null || Double.isNaN(position)) { return -1; } if (isLongitude) { position = GISUtils .getNextEquivalentLongitude(getCoordinateExtent().getLow(), position); } Double indexDbl = getIndex(position); int index = (int) Math.round(indexDbl); if (index < 0 || index >= size) { return -1; } return index; } RegularAxisImpl(String name, double firstValue, double spacing, int size,
            boolean isLongitude); @Override boolean wraps(); @Override double getCoordinateSpacing(); @Override Double getCoordinateValue(int index); @Override int size(); @Override boolean isAscending(); @Override String toString(); @Override Extent<Double> getCoordinateBounds(int index); @Override Extent<Double> getCoordinateExtent(); @Override int findIndexOf(Double position); @Override int findIndexOfUnconstrained(Double position); @Override int hashCode(); @Override boolean equals(Object obj);  }### Answer:
@Test public void testFindIndexOf() { int expectedIrregularValue = -1; assertEquals(expectedIrregularValue, longitudeAxis.findIndexOf(0.0)); assertEquals(expectedIrregularValue, longitudeAxis.findIndexOf(105.0)); assertEquals(expectedIrregularValue, longitudeAxis.findIndexOf(null)); assertEquals(expectedIrregularValue, longitudeAxis.findIndexOf(Double.NaN)); assertEquals(expectedIrregularValue, latitudeAxis.findIndexOf(10.0)); assertEquals(expectedIrregularValue, latitudeAxis.findIndexOf(30.0)); assertEquals(expectedIrregularValue, latitudeAxis.findIndexOf(null)); assertEquals(expectedIrregularValue, latitudeAxis.findIndexOf(Double.NaN)); double step = 1 / 5.0; for (int i = 0; i < LONGSIZE * SPACE / step; i++) { double value = 100 + i * step; int index = longitudeAxis.findIndexOf(value); int expectedIndex = (int) Math.round(i * step / SPACE); assertEquals(expectedIndex, index); } for (int i = 0; i < LATSIZE * SPACE / step; i++) { int index = latitudeAxis.findIndexOf(20 + i * step); int expectedIndex = (int) Math.round(i * step / SPACE); assertEquals(expectedIndex, index); } }