@Override
    public Object initialize(Object obj) {
        if (obj instanceof HazelcastInstanceAware aware) {
            aware.setHazelcastInstance(instance);
        }
        if (obj instanceof NodeAware aware) {
            aware.setNode(instance.node);
        }
        if (obj instanceof SerializationServiceAware aware) {
            aware.setSerializationService(instance.node.getSerializationService());
        }

        if (hasExternalContext) {
            return externalContext.initialize(obj);
        }
        return obj;
    }
@Test
    public void testInitialize() {
        DependencyInjectionUserClass initializedUserClass = (DependencyInjectionUserClass) serializationService.getManagedContext().initialize(userClass);

        assertEquals(hazelcastInstance, initializedUserClass.hazelcastInstance);
        assertEquals(node, initializedUserClass.node);
        assertEquals(serializationService, initializedUserClass.serializationService);
        assertTrue(userContext.wasCalled);
    }