Collection<T> () { final Collection<T> cached = myCached; if (cached != null) { return cached; } final ServiceLoader<T> loader = ServiceLoader.load(myExtensionClass, myExtensionClass.getClassLoader()); final List<T> extensions = new ArrayList<>(); for (T extension : loader) { extensions.add(extension); } myCached = extensions; return extensions; }