class MetadataEngine {

    public <A extends Comparable<A>> SortedAttributeMetadata<A, O> getSortedAttributeMetadata(Attribute<O, A> attribute) {
        @SuppressWarnings("unchecked")
        SortedKeyStatisticsIndex<A, O> index = getIndexOnAttribute(SortedKeyStatisticsAttributeIndex.class, attribute);
        return new SortedAttributeMetadata<>(index, openResourcesHandler, closeResourcesHandler);
    }

    public  MetadataEngine(IndexedCollection<O> indexedCollection, Supplier<QueryOptions> openResourcesHandler, Consumer<QueryOptions> closeResourcesHandler);

}