### Question:
MapContext extends AbstractMapItem implements ItemListener, Serializable, LayerListener { public CoordinateReferenceSystem getCoordinateReferenceSystem() { return crs; } MapContext(final CoordinateReferenceSystem crs); void setCoordinateReferenceSystem(final CoordinateReferenceSystem crs); CoordinateReferenceSystem getCoordinateReferenceSystem(); @Override List<MapItem> items(); List<MapLayer> layers(); Envelope getBounds(); Envelope getBounds(boolean onlyVisible); Envelope getAreaOfInterest(); void setAreaOfInterest(final Envelope aoi); @Override void itemChange(final CollectionChangeEvent<MapItem> evt); @Override void propertyChange(final PropertyChangeEvent evt); void addContextListener(final ContextListener listener); void removeContextListener(final ContextListener listener); @Override void styleChange(final MapLayer source, final EventObject event); static final String AREA_OF_INTEREST_PROPERTY; static final String BOUNDS_PROPERTY; }### Answer:
@Test public void testContextCreation() throws FactoryException { try { MapBuilder.createContext(null); fail("Creating MapContext with null CRS should raise an error"); }catch(Exception ex){ } MapContext context = MapBuilder.createContext(); assertNotNull(context); assertTrue(Utilities.equalsIgnoreMetadata(CommonCRS.WGS84.defaultGeographic(), context.getCoordinateReferenceSystem())); final CoordinateReferenceSystem wgs72 = CommonCRS.WGS72.defaultGeographic(); context = MapBuilder.createContext(wgs72); assertNotNull(context); assertTrue(Utilities.equalsIgnoreMetadata(wgs72, context.getCoordinateReferenceSystem())); }