class SpatialIndexCache extends IndexPartsCache<CoordinateReferenceSystem,T> {

    T uncheckedSelect( CoordinateReferenceSystem crs )
    {
        T existing = cache.get( crs );
        if ( existing != null )
        {
            return existing;
        }

        // Instantiate from factory. Do this under lock so that we coordinate with any concurrent call to close.
        // Concurrent calls to instantiating parts won't contend with each other since there's only
        // a single writer at a time anyway.
        instantiateCloseLock.lock();
        try
        {
            assertOpen();
            return cache.computeIfAbsent( crs, key ->
            {
                try
                {
                    return factory.newSpatial( crs );
                }
                catch ( IOException e )
                {
                    throw new UncheckedIOException( e );
                }
            } );
        }
        finally
        {
            instantiateCloseLock.unlock();
        }
    }

      SpatialIndexCache( Factory<T> factory );

}