@Override
    @SuppressWarnings("unchecked")
    public <T> T getExtGroupRealization(Class<T> extensionType, String name) throws ExtensionException {
        if (name == null) {
            throw new ExtensionException("name can not be null");
        }
        if (extensionType == null) {
            throw new ExtensionTypeException("extensionType can not be null");
        }
        if (!extensionType.isInterface()) {
            throw new ExtensionTypeException("extensionType must be an interface");
        }
        if (!extensionType.isAnnotationPresent(ExtensionPoint.class)) {
            throw new ExtensionTypeException("extensionType must be annotated with @ExtensionPoint");
        }

        Object instance = extensionInstances.get(makeKey(extensionType, name));
        if (instance == null) {
            throw new ExtensionNotFoundException("extension " + name + " not found");
        }

        if (!extensionType.isInstance(instance)) {
            throw new ExtensionTypeException("extension " + name + " is not an instance of " + extensionType.getName());
        }

        return (T) instance;
    }
@Test
    public void testGetExtGroupRealization() throws ExtensionException {
        ExtensionException exception;
        DefaultExtGroupRealizationManager manager = new DefaultExtGroupRealizationManager();

        exception = assertThrows(ExtensionException.class, () -> manager.getExtGroupRealization(null, null));
        assertEquals("name can not be null", exception.getMessage());

        exception = assertThrows(ExtensionException.class, () -> manager.getExtGroupRealization(null, ""));
        assertEquals("extensionType can not be null", exception.getMessage());

        exception = assertThrows(ExtensionException.class, () -> manager.getExtGroupRealization(ExtGroupRealization1.class, ""));
        assertEquals("extensionType must be an interface", exception.getMessage());

        exception = assertThrows(ExtensionException.class, () -> manager.getExtGroupRealization(IBusiness.class, ""));
        assertEquals("extensionType must be annotated with @ExtensionPoint", exception.getMessage());

        exception = assertThrows(ExtensionException.class, () -> manager.getExtGroupRealization(ExtA.class, "x"));
        assertEquals("extension x not found", exception.getMessage());

        manager.registerExtGroupRealization(new ExtGroupRealization2(), "ExtGroupRealization2");
        ExtA extA = manager.getExtGroupRealization(ExtA.class, "ExtGroupRealization2");
    }