### Question:
GameRuntime { public void addSystem(GameSystem aSystem) { List<GameSystem> theSystems = ArrayUtils.asList(systems); theSystems.add(aSystem); systems = theSystems.toArray(new GameSystem[theSystems.size()]); } GameRuntime(GameEventManager aEventManager, GameResourceLoader aResourceLoader,
            LUAScriptEngineFactory aScriptEngineFactory, Logger aLogger); Logger getLogger(); GameResourceCache getResourceCache(); GameEventManager getEventManager(); void addSystem(GameSystem aSystem); GameSystem[] getSystems(); IORegistry getIORegistry(); LUAScriptEngineFactory getScriptEngineFactory();  }### Answer:
@Test public void testAddSystem() throws Exception { GameEventManager theEventManager = mock(GameEventManager.class); GameResourceLoader theResourceLoader = mock(GameResourceLoader.class); LUAScriptEngineFactory theScriptEngineFactory = mock(LUAScriptEngineFactory.class); GameRuntime theRuntime = new GameRuntime(theEventManager, theResourceLoader, theScriptEngineFactory, new DefaultLogger()); assertNotNull(theRuntime.getSystems()); assertEquals(0, theRuntime.getSystems().length); GameSystem theSystem = mock(GameSystem.class); theRuntime.addSystem(theSystem); assertEquals(1, theRuntime.getSystems().length); assertSame(theSystem, theRuntime.getSystems()[0]); }