+ default <T> Component.PublishedType<T> getSingleton(Class<T> type) {
+ SortedSet<Component<? extends T>> found = find(type, null);
+ if (found.size() == 0)
+ throw new IllegalStateException("No component found for " + type);
+ return found.first().getType(type);
+ }
+
+ default <T> T getObject(Class<T> clss) {
+ SortedSet<Component<? extends T>> found = find(clss, null);
+ if (found.size() == 0)
+ return null;
+ return found.first().get();
+ }
+