### Question:
RegionMask implements Grid { public static void setSpatialResolution(SpatialResolution spatialResolution) { final GridDef gridDef = spatialResolution.getGridDef(); width = gridDef.getWidth(); height = gridDef.getHeight(); RegionMask.gridDef = gridDef; } private  RegionMask(String name, boolean[][] samples); static void setSpatialResolution(SpatialResolution spatialResolution); static RegionMask create(String name, String data); static RegionMask create(String name, double west, double north, double east, double south); String getName(); Coverage getCoverage(); int getWidth(); int getHeight(); @Override GridDef getGridDef(); @Override boolean getSampleBoolean(int gridX, int gridY); @Override int getSampleInt(int gridX, int gridY); @Override double getSampleDouble(int gridX, int gridY); static RegionMask combine(RegionMaskList regionMaskList);  }### Answer:
@Test public void testSetSpatialResolution() { RegionMask.setSpatialResolution(SpatialResolution.DEGREE_2_00); try { final RegionMask mask = RegionMask.create("X", 0, 10, 10, 0); assertEquals(180, mask.getWidth()); assertEquals(90, mask.getHeight()); final GridDef gridDef = mask.getGridDef(); assertNotNull(gridDef); assertEquals(2.0, gridDef.getResolutionX(), 1e-8); assertEquals(2.0, gridDef.getResolutionY(), 1e-8); } finally { RegionMask.setSpatialResolution(SpatialResolution.DEGREE_5_00); } }