class Reflections {

    public Set<Class<?>> getTypesAnnotatedWith(Class<? extends Annotation> annotation) {
        ensureScan();
        synchronized (MONITOR) {
            Set<Class<?>> result = annotationClassToType.get(annotation);
            if (result != null) {
                return result;
            }
            /* not tried before... */
            Set<Class<?>> newResult = new LinkedHashSet<>();

            visitEveryClass(new Visitor() {

                @Override
                public void visit(Class<?> clazz) {
                    if (clazz.getAnnotation(annotation) != null) {
                        newResult.add(clazz);
                    }
                }
            });

            annotationClassToType.put(annotation, newResult);
            return newResult;
        }
    }

    public  Reflections();

}