Program: 112932
Project: 112932
Buggy source:
@Test public void testMosaic() throws Exception {
  MapProjection.SKIP_SANITY_CHECKS=true;
  TestUtils.deleteAll(dataStoreOptions);
  final Landsat8BasicCommandLineOptions analyzeOptions=new Landsat8BasicCommandLineOptions();
  analyzeOptions.setCqlFilter(String.format("String_Node_Str",SceneFeatureIterator.SHAPE_ATTRIBUTE_NAME,WEST,SOUTH,EAST,NORTH,BandFeatureIterator.BAND_ATTRIBUTE_NAME,SceneFeatureIterator.ACQUISITION_DATE_ATTRIBUTE_NAME,"String_Node_Str",MIN_PATH,MAX_PATH,MIN_ROW,MAX_ROW));
  analyzeOptions.setNBestPerSpatial(true);
  analyzeOptions.setNBestScenes(1);
  analyzeOptions.setUseCachedScenes(true);
  final Landsat8DownloadCommandLineOptions downloadOptions=new Landsat8DownloadCommandLineOptions();
  final Landsat8RasterIngestCommandLineOptions ingestOptions=new Landsat8RasterIngestCommandLineOptions();
  ingestOptions.setRetainImages(true);
  ingestOptions.setCreatePyramid(true);
  ingestOptions.setCreateHistogram(true);
  ingestOptions.setCoverageName("String_Node_Str");
  ingestOptions.setCropToSpatialConstraint(true);
  final RasterIngestTester runner=new RasterIngestTester(dataStoreOptions,analyzeOptions,downloadOptions,ingestOptions,null);
  runner.runInternal(null);
  final StringBuilder str=new StringBuilder(StoreFactoryOptions.GEOWAVE_NAMESPACE_OPTION).append("String_Node_Str").append(dataStoreOptions.getGeowaveNamespace()).append("String_Node_Str").append(Interpolation.INTERP_NEAREST);
  str.append("String_Node_Str").append(GeoWaveStoreFinder.STORE_HINT_KEY).append("String_Node_Str").append(dataStoreOptions.getType());
  final Map<String,String> options=dataStoreOptions.getOptionsAsMap();
  for (  final Entry<String,String> entry : options.entrySet()) {
    if (!entry.getKey().equals(StoreFactoryOptions.GEOWAVE_NAMESPACE_OPTION)) {
      str.append("String_Node_Str").append(entry.getKey()).append("String_Node_Str").append(entry.getValue());
    }
  }
  final GeneralEnvelope queryEnvelope=new GeneralEnvelope(new double[]{WEST,SOUTH},new double[]{EAST,NORTH});
  queryEnvelope.setCoordinateReferenceSystem(GeoWaveGTRasterFormat.DEFAULT_CRS);
  final GeoWaveRasterReader reader=new GeoWaveRasterReader(GeoWaveRasterConfig.readFromConfigParams(str.toString()));
  final GridCoverage2D gridCoverage=reader.renderGridCoverage("String_Node_Str",new Rectangle(0,0,1024,1024),queryEnvelope,null,null,null);
  final RenderedImage result=gridCoverage.getRenderedImage();
  final BufferedImage reference=ImageIO.read(new File(REFERENCE_LANDSAT_IMAGE_PATH));
  TestUtils.testTileAgainstReference(PlanarImage.wrapRenderedImage(result).getAsBufferedImage(),reference,0,0.005);
  MapProjection.SKIP_SANITY_CHECKS=false;
}

Fixed version (ground truth):
@Test public void testMosaic() throws Exception {
  JAIExt.initJAIEXT();
  MapProjection.SKIP_SANITY_CHECKS=true;
  TestUtils.deleteAll(dataStoreOptions);
  final Landsat8BasicCommandLineOptions analyzeOptions=new Landsat8BasicCommandLineOptions();
  analyzeOptions.setCqlFilter(String.format("String_Node_Str",SceneFeatureIterator.SHAPE_ATTRIBUTE_NAME,WEST,SOUTH,EAST,NORTH,BandFeatureIterator.BAND_ATTRIBUTE_NAME,SceneFeatureIterator.ACQUISITION_DATE_ATTRIBUTE_NAME,"String_Node_Str",MIN_PATH,MAX_PATH,MIN_ROW,MAX_ROW));
  analyzeOptions.setNBestPerSpatial(true);
  analyzeOptions.setNBestScenes(1);
  analyzeOptions.setUseCachedScenes(true);
  final Landsat8DownloadCommandLineOptions downloadOptions=new Landsat8DownloadCommandLineOptions();
  final Landsat8RasterIngestCommandLineOptions ingestOptions=new Landsat8RasterIngestCommandLineOptions();
  ingestOptions.setRetainImages(true);
  ingestOptions.setCreatePyramid(true);
  ingestOptions.setCreateHistogram(true);
  ingestOptions.setCoverageName("String_Node_Str");
  ingestOptions.setCropToSpatialConstraint(true);
  final RasterIngestTester runner=new RasterIngestTester(dataStoreOptions,analyzeOptions,downloadOptions,ingestOptions,null);
  runner.runInternal(null);
  final StringBuilder str=new StringBuilder(StoreFactoryOptions.GEOWAVE_NAMESPACE_OPTION).append("String_Node_Str").append(dataStoreOptions.getGeowaveNamespace()).append("String_Node_Str").append(Interpolation.INTERP_NEAREST);
  str.append("String_Node_Str").append(GeoWaveStoreFinder.STORE_HINT_KEY).append("String_Node_Str").append(dataStoreOptions.getType());
  final Map<String,String> options=dataStoreOptions.getOptionsAsMap();
  for (  final Entry<String,String> entry : options.entrySet()) {
    if (!entry.getKey().equals(StoreFactoryOptions.GEOWAVE_NAMESPACE_OPTION)) {
      str.append("String_Node_Str").append(entry.getKey()).append("String_Node_Str").append(entry.getValue());
    }
  }
  final GeneralEnvelope queryEnvelope=new GeneralEnvelope(new double[]{WEST,SOUTH},new double[]{EAST,NORTH});
  queryEnvelope.setCoordinateReferenceSystem(GeoWaveGTRasterFormat.DEFAULT_CRS);
  final GeoWaveRasterReader reader=new GeoWaveRasterReader(GeoWaveRasterConfig.readFromConfigParams(str.toString()));
  final GridCoverage2D gridCoverage=reader.renderGridCoverage("String_Node_Str",new Rectangle(0,0,1024,1024),queryEnvelope,null,null,null);
  final RenderedImage result=gridCoverage.getRenderedImage();
  final BufferedImage reference=ImageIO.read(new File(REFERENCE_LANDSAT_IMAGE_PATH));
  TestUtils.testTileAgainstReference(PlanarImage.wrapRenderedImage(result).getAsBufferedImage(),reference,0,0.005);
  MapProjection.SKIP_SANITY_CHECKS=false;
}