Buggy code:
public class TmsReader extends TmsTileStore implements TileStoreReader { public TmsReader ( final CoordinateReferenceSystem coordinateReferenceSystem , final Path location ) { } @ Override public BoundingBox getBounds ( ) throws TileStoreException { } @ Override public long countTiles ( ) { } @ Override public long getByteSize ( ) throws TileStoreException { } @ Override public BufferedImage getTile ( final int column , final int row , final int zoomLevel ) throws TileStoreException { } @ Override public BufferedImage getTile ( final CrsCoordinate coordinate , final int zoomLevel ) throws TileStoreException { } @ Override public Set < Integer > getZoomLevels ( ) throws TileStoreException { } @ Override public Stream < TileHandle > stream ( ) { } @ Override public Stream < TileHandle > stream ( final int zoomLevel ) { } @ Override public String getImageType ( ) { } @ Override public Dimensions < Integer > getImageDimensions ( ) { } private void calculateBounds ( ) throws TileStoreException { } private long countFiles ( final File directory ) { } private long calculateStoreSize ( ) throws IOException { } private void calculateZoomLevels ( ) { } private TileHandle getTileHandle ( final Path path ) { final File file = path . toFile ( ) ; final String absolutePath = file . getAbsolutePath ( ) ; final Matcher tmsFileMatch = TmsReader . TmsFilePattern . matcher ( absolutePath ) ; if ( tmsFileMatch . matches ( ) ) { try { final MimeType mimeType = new MimeType ( Files . probeContentType ( path ) ) ; if ( mimeType . getPrimaryType ( ) . toLowerCase ( ) . equals ( "image" ) ) { final int zoomLevel = Integer . parseInt ( tmsFileMatch . group ( 1 ) ) ; final int column = Integer . parseInt ( tmsFileMatch . group ( 2 ) ) ; final int row = Integer . parseInt ( tmsFileMatch . group ( 3 ) ) ; return new TileHandle ( ) { private final TileMatrixDimensions matrix = TmsReader . this . tileScheme . dimensions ( zoomLevel ) ; private boolean gotImage = false ; private BufferedImage image ; @ Override public int getZoomLevel ( ) { return zoomLevel ; } @ Override public int getColumn ( ) { return column ; } @ Override public int getRow ( ) { return row ; } @ Override public TileMatrixDimensions getMatrix ( ) throws TileStoreException { return this . matrix ; } @ Override public CrsCoordinate getCrsCoordinate ( ) throws TileStoreException { return TmsReader . this . tileToCrsCoordinate ( column , row , zoomLevel , Origin ) ; } @ Override public CrsCoordinate getCrsCoordinate ( final TileOrigin corner ) throws TileStoreException { <START_BUG> return TmsReader . this . tileToCrsCoordinate ( column , row , zoomLevel , Origin ) ; <END_BUG> } @ Override public BoundingBox getBounds ( ) throws TileStoreException { return TmsReader . this . getTileBoundingBox ( column , row , zoomLevel ) ; } @ Override public BufferedImage getImage ( ) throws TileStoreException { if ( ! ( this . gotImage ) ) { this . image = TmsReader . this . getTile ( column , row , zoomLevel ) ; this . gotImage = true ; } return this . image ; } } ; } } catch ( MimeTypeParseException | IOException ex ) { } } return null ; } private static Range < Integer > getTmsRange ( final File directory ) throws TileStoreException { } private Stream < File > getTiles ( final int column , final int row , final int zoomLevel ) { } private Stream < TileHandle > stream ( final Path startLocation ) { } private static boolean fileIsImage ( final File file ) { } private Set < Integer > zoomLevels = null ; private BoundingBox bounds = null ; private long tileCount = - 1 ; private long storeSize = - 1 ; private static Pattern TmsFilePattern = Pattern . compile ( ".*(?:\\\\|//)([0-9]+)(?:\\\\|//)([0-9]+)(?:\\\\|//)([0-9]+)\\.[^\\\\//]*$" ) ; }

Fix:
return TmsReader . this . tileToCrsCoordinate ( column , row , zoomLevel , corner ) ;