### Question:
AddArmsPresentation extends AddListItemsPresentation<Arm> { @Override public void rename(int idx, String newName) { Arm oldArm = d_list.get(idx); d_study.replaceArm(oldArm, oldArm.rename(newName)); } AddArmsPresentation(Study study, String itemName, int minElements); @Override ObservableList<Note> getNotes(Arm t); @Override ValueModel getRemovable(Arm t); @Override Arm createItem(); void setStudy(Study study); Study getStudy(); @Override void rename(int idx, String newName);  }### Answer:
@Test public void testRename() { AddArmsPresentation presentation = new AddArmsPresentation(d_study, "Arm", 2); ListDataListener mockListener = EasyMock.createStrictMock(ListDataListener.class); mockListener.contentsChanged(ListDataEventMatcher.eqListDataEvent( new ListDataEvent(d_study.getArms(), ListDataEvent.CONTENTS_CHANGED, 0, 0))); EasyMock.replay(mockListener); d_study.getArms().addListDataListener(mockListener); final String newName = "Other arm"; presentation.rename(0, newName); EasyMock.verify(mockListener); assertEquals(newName, d_study.getArms().get(0).getName()); assertEquals(newName, presentation.getList().get(0).getName()); }