final GridSampleDimension sampleDim = new GridSampleDimension("original",
SampleDimensionType.REAL_64BITS, ColorInterpretation.GRAY_INDEX,
null, null, new double[]{-9999.0}, -1000d, 1000d, 1d, 0d, null);
// Setting coverage dimension
final CoverageDimensionImpl coverageDim = new CoverageDimensionImpl();
final String wrappedName = "wrapped";
coverageDim.setName(wrappedName);
coverageDim.setDimensionType(SampleDimensionType.REAL_64BITS);
final double newMinimum = -2000d;
final double newMaximum = 2000d;
final NumberRange<Double> range = new NumberRange<Double>(Double.class, newMinimum, newMaximum);
coverageDim.setRange(range);
final List<Double> nullValues = new ArrayList<Double>();
final double noData1 = -32768d;
final double noData2 = -32767d;
nullValues.add(noData1);
nullValues.add(noData2);
coverageDim.setNullValues(nullValues);
final SampleDimension wrappedDim = new WrappedSampleDimension(sampleDim, coverageDim);
double[] noData = wrappedDim.getNoDataValues();
assertEquals(2, noData.length);