public static <T extends Component> T findOrCreateComponent(Class<T> clazz, String name, Map<Object, Object> options) { if (name == null) { name = "default"; } T component = findComponent(clazz, name); String fullName = fullComponentName(clazz, name); if (component != null) { log.debug("Returning existing component for " + fullName + ", ignoring options."); } else { component = getComponentProvider(clazz, true).create(name, new Options<>(options)); components.put(fullName, component); } return component; }