class OntologyCacheImpl implements OntologyCache {

    @Override
    public void clearCache(@Nonnull Resource recordId) {
        getOntologyCache().ifPresent(cache -> {
            for (Cache.Entry<String, Ontology> entry : cache) {
                if (entry.getKey().startsWith(recordId.stringValue())) {
                    cache.remove(entry.getKey());
                }
            }
        });
    }

}