ModisFileReader { static Range createRangeFromArray(int[] rangeArray) { if (rangeArray != null && rangeArray.length >= 2) { final Range range = new Range(); range.setMin(rangeArray[0] < rangeArray[1] ? rangeArray[0] : rangeArray[1]); range.setMax(rangeArray[0] > rangeArray[1] ? rangeArray[0] : rangeArray[1]); return range; } return null; } ModisFileReader(); void addRastersAndGeoCoding(final Product product, ModisGlobalAttributes globalAttribs, NetCDFVariables netCDFVariables); ModisBandReader getBandReader(final Band band); void close();  }
@Test public void testCreateRangeFromArray_nullArray() { assertNull(ModisFileReader.createRangeFromArray(null)); }
@Test public void testCreateRangeFromArray_tooShortArray() { assertNull(ModisFileReader.createRangeFromArray(new int[]{34})); }
@Test public void testCreateRangeFromArray_orderedInts() { final Range range = ModisFileReader.createRangeFromArray(new int[]{34, 3809}); assertNotNull(range); assertEquals(34.0, range.getMin(), 1e-8); assertEquals(3809.0, range.getMax(), 1e-8); }
@Test public void testCreateRangeFromArray_inverseOrderedInts() { final Range range = ModisFileReader.createRangeFromArray(new int[]{9886, 14}); assertNotNull(range); assertEquals(14.0, range.getMin(), 1e-8); assertEquals(9886.0, range.getMax(), 1e-8); }