@Override
    public DbEntitiesCatalog get() {
        final Stopwatch stopwatch = Stopwatch.createStarted();
        final DbEntitiesCatalog catalog = scan(packagesToScan, packagesToExclude, chainingClassLoader);
        stopwatch.stop();
        LOG.info("{} entities have been scanned and added to DB Entity Catalog, it took {}", catalog.size(), stopwatch);
        return catalog;
    }
@Test
    void testExcludingPackagesWorkCorrectly() {
        DbEntitiesScanner scanner = new DbEntitiesScanner(
                new String[]{"org.graylog2.indexer"},
                new String[]{"org.graylog2.indexer.indexset"}
        );
        final DbEntitiesCatalog dbEntitiesCatalog = scanner.get();

        final Optional<DbEntityCatalogEntry> entryByCollectionName = dbEntitiesCatalog.getByCollectionName("index_sets");

        assertFalse(entryByCollectionName.isPresent());
    }