### Question:
CreateAdministratorAction extends AdministratorAction { @Override protected void execute() { super.execute(); manager.addAdministrator(administrator); } CreateAdministratorAction(Administrator administrator, AdministratorManager manager); @Override String getExecuteText(); @Override String getUnexecuteText();  }### Answer:
@Test public void checkAdministratorAddedTest() { CreateAdministratorAction action = new CreateAdministratorAction(baseAdministrator, manager); invoker.execute(action); assertEquals(2, manager.getAdministrators().size()); }
@Test public void checkAdministratorAddedUndoTest() { CreateAdministratorAction action = new CreateAdministratorAction(baseAdministrator, manager); invoker.execute(action); invoker.undo(); assertEquals(1, manager.getAdministrators().size()); }
@Test public void checkAdministratorMultipleAddsOneUndoTest() { CreateAdministratorAction action = new CreateAdministratorAction(baseAdministrator, manager); invoker.execute(action); Administrator second = new Administrator("First2", "pass"); CreateAdministratorAction secondAction = new CreateAdministratorAction(second, manager); invoker.execute(secondAction); invoker.undo(); assertEquals(baseAdministrator, manager.getAdministrators().get(1)); assertEquals(2, manager.getAdministrators().size()); }
@Test public void checkAdministratorMultipleAddsOneUndoRedoTest() { CreateAdministratorAction action = new CreateAdministratorAction(baseAdministrator, manager); invoker.execute(action); Administrator second = new Administrator("First2", "pass"); CreateAdministratorAction secondAction = new CreateAdministratorAction(second, manager); invoker.execute(secondAction); invoker.undo(); assertEquals(baseAdministrator, manager.getAdministrators().get(1)); assertEquals(2, manager.getAdministrators().size()); invoker.redo(); assertEquals(baseAdministrator, manager.getAdministrators().get(1)); assertEquals(second, manager.getAdministrators().get(2)); assertEquals(3, manager.getAdministrators().size()); }