### Question:
STKTerrainImageProvider implements ImageProvider<ZYXImageKey> { @Override public Image getImage(ZYXImageKey key) { DataModelCategory category = new DataModelCategory(myServerUrl, QuantizedMesh.class.getName(), myTileSetName); List<PropertyMatcher<?>> matchers = New.list(); ZYXKeyPropertyMatcher keyMatcher = new ZYXKeyPropertyMatcher(Constants.KEY_PROPERTY_DESCRIPTOR, key); matchers.add(keyMatcher); SimpleQuery<QuantizedMesh> query = new SimpleQuery<>(category, Constants.QUANTIZED_MESH_PROPERTY_DESCRIPTOR, matchers); QueryTracker tracker = myDataRegistry.performQuery(query); QuantizedMesh mesh = null; if (query.getResults() != null && !query.getResults().isEmpty()) { mesh = query.getResults().get(0); } else if (tracker.getException() != null) { LOGGER.error(tracker.getException(), tracker.getException()); } return mesh; } STKTerrainImageProvider(DataRegistry dataRegistry, String serverUrl, String tileSetName); @Override Image getImage(ZYXImageKey key);  }### Answer:
@Test public void testGetImage() { EasyMockSupport support = new EasyMockSupport(); QuantizedMesh mesh = new QuantizedMesh(ByteBuffer.wrap(QuantizedMeshTest.createMeshByes())); DataRegistry dataRegistry = createDataRegistry(support, mesh); support.replayAll(); STKTerrainImageProvider provider = new STKTerrainImageProvider(dataRegistry, ourServerUrl, ourTileSetName); Image image = provider.getImage(ourImageKey); assertEquals(mesh, image); support.verifyAll(); }
@Test public void testGetImageNull() { EasyMockSupport support = new EasyMockSupport(); DataRegistry dataRegistry = createDataRegistry(support, null); support.replayAll(); STKTerrainImageProvider provider = new STKTerrainImageProvider(dataRegistry, ourServerUrl, ourTileSetName); Image image = provider.getImage(ourImageKey); assertNull(image); support.verifyAll(); }