EntityScanner { public static EntityScanner scanAllPackages() { return scanPackages(null, null, Entity.class); } private  EntityScanner(String[] packagesToScan); static EntityScanner scanAllPackages(); static EntityScanner scanPackages(String... packages); static EntityScanner scanPackages(List<ClassLoader> loaders, String... packages); EntityScanner addTo(Configuration configuration); List<Class<?>> result();  }
@Test public void scanAllPackages() { List<Class<?>> classes = EntityScanner .scanPackages(PERSISTENT_PACKAGE, OTHER_PERSISTENT_PACKAGE).result(); assertThat(classes).containsOnlyOnce(ENTITY_CLASSES).containsOnlyOnce(OTHER_ENTITY_CLASSES) .doesNotContain(NotEntity.class); }