Source:
public static void addEntityManagementRelatedClasses(Context context) { ModuleEnvironment environment = context.get(ModuleManager.class).getEnvironment(); NetworkSystem networkSystem = context.get(NetworkSystem.class); PojoEntityManager entityManager = new PojoEntityManager(); context.put(EntityManager.class, entityManager); context.put(EngineEntityManager.class, entityManager); TypeSerializationLibrary typeSerializationLibrary = context.get(TypeSerializationLibrary.class); typeSerializationLibrary.add(EntityRef.class, new EntityRefTypeHandler(entityManager)); entityManager.setTypeSerializerLibrary(typeSerializationLibrary); PrefabManager prefabManager = new PojoPrefabManager(context); entityManager.setPrefabManager(prefabManager); context.put(PrefabManager.class, prefabManager); EntitySystemLibrary library = context.get(EntitySystemLibrary.class); entityManager.setComponentLibrary(library.getComponentLibrary()); EventSystem eventSystem; if (RecordAndReplayUtils.getRecordAndReplayStatus() == RecordAndReplayStatus.PREPARING_REPLAY) { eventSystem = new EventSystemReplayImpl(library.getEventLibrary(), networkSystem, entityManager); } else { eventSystem = new EventSystemImpl(library.getEventLibrary(), networkSystem); } entityManager.setEventSystem(eventSystem); context.put(EventSystem.class, eventSystem); context.put(OneOfProviderFactory.class, new OneOfProviderFactory()); registerComponents(library.getComponentLibrary(), environment); registerEvents(entityManager.getEventSystem(), environment); RecordAndReplaySerializer.setEntityManager(entityManager); }

Target:
public static void addEntityManagementRelatedClasses(Context context) { ModuleEnvironment environment = context.get(ModuleManager.class).getEnvironment(); NetworkSystem networkSystem = context.get(NetworkSystem.class); PojoEntityManager entityManager = new PojoEntityManager(); context.put(EntityManager.class, entityManager); context.put(EngineEntityManager.class, entityManager); TypeSerializationLibrary typeSerializationLibrary = context.get(TypeSerializationLibrary.class); typeSerializationLibrary.add(EntityRef.class, new EntityRefTypeHandler(entityManager)); entityManager.setTypeSerializerLibrary(typeSerializationLibrary); PrefabManager prefabManager = new PojoPrefabManager(context); entityManager.setPrefabManager(prefabManager); context.put(PrefabManager.class, prefabManager); EntitySystemLibrary library = context.get(EntitySystemLibrary.class); entityManager.setComponentLibrary(library.getComponentLibrary()); RecordAndReplayUtils recordAndReplayUtils = context.get(RecordAndReplayUtils.class); CharacterStateEventPositionMap characterStateEventPositionMap = context.get(CharacterStateEventPositionMap.class); RecordedEventStore recordedEventStore = new RecordedEventStore(); EntityIdMap entityIdMap = new EntityIdMap(); context.put(EntityIdMap.class, entityIdMap); RecordAndReplaySerializer recordAndReplaySerializer = new RecordAndReplaySerializer(entityManager, recordedEventStore, entityIdMap, recordAndReplayUtils, characterStateEventPositionMap); context.put(RecordAndReplaySerializer.class, recordAndReplaySerializer); EventSystem eventSystem = createEventSystem(networkSystem, entityManager, library, recordedEventStore, entityIdMap, recordAndReplaySerializer, recordAndReplayUtils); entityManager.setEventSystem(eventSystem); context.put(EventSystem.class, eventSystem); context.put(OneOfProviderFactory.class, new OneOfProviderFactory()); registerComponents(library.getComponentLibrary(), environment); registerEvents(entityManager.getEventSystem(), environment); }