### Question:
TerrainUtil { public double getElevationInMeters(MapContext<DynamicViewer> mapContext, GeographicPosition position) { double elevation = 0.; Projection proj = mapContext.getRawProjection(); if (proj.getElevationManager() != null) { elevation = proj.getElevationManager().getElevationM(position, true); elevation = Math.max(0., elevation); } return elevation; } private  TerrainUtil(); static TerrainUtil getInstance(); double getElevationInMeters(MapContext<DynamicViewer> mapContext, GeographicPosition position);  }### Answer:
@Test public void testGetElevationInMeters() { EasyMockSupport support = new EasyMockSupport(); GeographicPosition pos = new GeographicPosition(LatLonAlt.createFromDegrees(10, 9)); MapContext<DynamicViewer> mapContext = createMapContext(support, new MockedElevationManager(pos)); support.replayAll(); double elevation = TerrainUtil.getInstance().getElevationInMeters(mapContext, pos); assertEquals(1001.1, elevation, 0d); support.verifyAll(); }