@@ -0,0 +1,2198 @@
+package de.gurkenlabs.litiengine.entities;%0A%0Aimport org.junit.jupiter.api.Test;%0A%0Aimport static org.mockito.Mockito.mock;%0Aimport static org.mockito.Mockito.times;%0Aimport static org.mockito.Mockito.verify;%0Aimport static org.mockito.Mockito.when;%0A%0Apublic class EntityControllersTests %7B%0A    @Test%0A    public void detachAll_delegatesCorrectly() %7B%0A        // arrange%0A        final EntityControllers controllers = new EntityControllers();%0A        final IEntityController controllerA = mock(EntityControllerDummyA.class);%0A        final IEntityController controllerB = mock(EntityControllerDummyB.class);%0A%0A        final IEntity mockedEntity = mock(IEntity.class);%0A        when(mockedEntity.isLoaded()).thenReturn(false); // skip attach because irrelevant for test scenario%0A        when(controllerA.getEntity()).thenReturn(mockedEntity);%0A        when(controllerB.getEntity()).thenReturn(mockedEntity);%0A%0A        controllers.addController(controllerA);%0A        controllers.addController(controllerB);%0A%0A        // act%0A        controllers.detachAll();%0A%0A        // assert%0A        verify(controllerA, times(1)).detach();%0A        verify(controllerB, times(1)).detach();%0A    %7D%0A%0A    @Test%0A    public void attachAll_delegatesCorrectly() %7B%0A        // arrange%0A        final EntityControllers controllers = new EntityControllers();%0A        final IEntityController controllerA = mock(EntityControllerDummyA.class);%0A        final IEntityController controllerB = mock(EntityControllerDummyB.class);%0A%0A        final IEntity mockedEntity = mock(IEntity.class);%0A        when(mockedEntity.isLoaded()).thenReturn(false); // avoid prematurely calling attach()%0A        when(controllerA.getEntity()).thenReturn(mockedEntity);%0A        when(controllerB.getEntity()).thenReturn(mockedEntity);%0A%0A        controllers.addController(controllerA);%0A        controllers.addController(controllerB);%0A%0A        // act%0A        controllers.attachAll();%0A%0A        // assert%0A        verify(controllerA, times(1)).attach();%0A        verify(controllerB, times(1)).attach();%0A    %7D%0A%0A    private abstract class EntityControllerDummyA implements IEntityController %7B%0A    %7D%0A    private abstract class EntityControllerDummyB implements IEntityController %7B%0A    %7D%0A%7D%0A

add EntityControllers tests for de-/attachAll