@Override
    public DataSerializableFactory createFactory() {
        return typeId -> switch (typeId) {
            case MAP_REPLICATION_UPDATE -> new WanMapAddOrUpdateEvent();
            case MAP_REPLICATION_REMOVE -> new WanMapRemoveEvent();
            case WAN_MAP_ENTRY_VIEW -> new WanMapEntryView<>();
            case WAN_CACHE_ENTRY_VIEW -> new WanCacheEntryView<>();
            case WAN_EVENT_CONTAINER_REPLICATION_OPERATION -> new WanEventContainerReplicationOperation();
            default -> throw new IllegalArgumentException("Unknown type-id: " + typeId);
        };
    }
@Test
    public void testExistingTypes() {
        WanDataSerializerHook hook = new WanDataSerializerHook();
        IdentifiedDataSerializable mapUpdate = hook.createFactory()
                .create(WanDataSerializerHook.MAP_REPLICATION_UPDATE);
        assertTrue(mapUpdate instanceof WanMapAddOrUpdateEvent);

        IdentifiedDataSerializable mapRemove = hook.createFactory()
                .create(WanDataSerializerHook.MAP_REPLICATION_REMOVE);
        assertTrue(mapRemove instanceof WanMapRemoveEvent);
    }