add static factory method
@@ -26,11 +26,15 @@ import java.util.stream.Collectors;
public class PackageManager {
+ public static PackageManager createInstance() {
+ return new PackageManager(new PackageRegistryImpl());
+ }
+
private final ExecutorService executorService = Executors.newSingleThreadExecutor();
private final PackageRegistry packageRegistry;
- public PackageManager(PackageRegistry packageRegistry) {
+ PackageManager(PackageRegistry packageRegistry) {
this.packageRegistry = packageRegistry;
}
