private static boolean setExtensionOnBusIfMissing(Bus bus,
Map<String, Extension> exts, String extensionName) {
if (exts.containsKey(extensionName)
&& !bus.hasExtensionByName(extensionName)) {
ExtensionManager extMan = bus.getExtension(ExtensionManager.class);
if (extMan instanceof ExtensionManagerImpl) {
((ExtensionManagerImpl) extMan).add(exts.get(extensionName));
return true;
} else {
throw new RuntimeException(