}
if (utility == null) {
// Dynamically load a utility class declared under META-INF/services/"utilityType"
try {
ServiceDeclaration utilityDeclaration =
ServiceDiscovery.getInstance().getServiceDeclaration(utilityType.getName());
if (utilityDeclaration != null) {
Class<?> utilityClass = utilityDeclaration.loadClass();
// Construct the utility
Constructor<?>[] constructors = utilityClass.getConstructors();
Constructor<?> constructor = getConstructor(constructors, ExtensionPointRegistry.class, Map.class);
if (constructor != null) {
utility = constructor.newInstance(extensionPoints, utilityDeclaration.getAttributes());
} else {
constructor = getConstructor(constructors, ExtensionPointRegistry.class);
if (constructor != null) {
utility = constructor.newInstance(extensionPoints);
} else {