class OrmFactoryRegistryImpl implements OrmFactoryRegistry {

    @Override
    public <T extends Thing> List<OrmFactory<? extends T>> getSortedFactoriesOfType(Class<T> type) {
        return getFactoryStreamOfType(type)
                .sorted((factory1, factory2) -> factory2.getParentTypeIRIs().size()
                        - factory1.getParentTypeIRIs().size())
                .collect(Collectors.toList());
    }

}