package etomica.meta;

import org.reflections.Reflections;

import java.util.Set;

public class ComponentIndex<T> {
    private final Class<T> componentClass;

    private static final Reflections reflections = new Reflections("etomica");

    public ComponentIndex(Class<T> componentClass) {
        this.componentClass = componentClass;
    }

    public Set<Class<? extends T>> getComponentSet() {
        return reflections.getSubTypesOf(componentClass);
    }
}

@@ -76,16 +76,64 @@
 l.Set;%0A%0A
+import static etomica.meta.Common.REFLECTIONS;%0A%0A
 public c
@@ -205,87 +205,8 @@
 s;%0A%0A
-    private static final Reflections reflections = new Reflections(%22etomica%22);%0A
 %0A   
@@ -378,27 +378,27 @@
  return 
-reflections
+REFLECTIONS
 .getSubT

Use common reflections instance to avoid scanning twice