TileMatrix { public long getTilePixelsX() { return tileSizeX.longValue(); } TileMatrix( String identifier, SpatialMetadata spatialMetadata, BigInteger tileSizeX, BigInteger tileSizeY,
                       double resolution, BigInteger numTilesX, BigInteger numTilesY );  TileMatrix( String identifier, SpatialMetadata spatialMetadata, long tileSizeX, long tileSizeY,
                       double resolution, long numTilesX, long numTilesY ); SpatialMetadata getSpatialMetadata(); long getTilePixelsX(); long getTilePixelsY(); double getResolution(); long getNumTilesX(); long getNumTilesY(); double getTileWidth(); double getTileHeight(); String getIdentifier();  }
@Test public void testGetTile() throws UnknownCRSException { GeometryFactory fac = new GeometryFactory(); ICRS crs = CRSManager.lookup( "EPSG:4326" ); Envelope env = fac.createEnvelope( -10, -10, 10, 10, crs ); SpatialMetadata smd = new SpatialMetadata( env, Collections.singletonList( crs ) ); TileMatrix md = new TileMatrix( "someid", smd, 256, 256, 1, 1, 1 ); TileDataLevel tm = mock( TileDataLevel.class ); Tile t = mock( Tile.class ); tm.getMetadata(); tm.getTile( 0, 0 ); when( tm.getMetadata() ).thenReturn( md ); when( tm.getTile( 0, 0 ) ).thenReturn( t ); assertEquals( 256, tm.getMetadata().getTilePixelsX() ); verify( tm ).getTile( 0, 0 ); }