DirectoryChangeModel { public String getEntryName(int i) { Entry e = getEntry(i); return e == null ? "" : e.getName(); } DirectoryChangeModel(Difference d, IdeaGateway gw, boolean editableRightContent); Difference getDifference(); boolean isFile(); String getEntryName(int i); Entry getEntry(int i); FileDifferenceModel getFileDifferenceModel(); boolean canShowFileDifference(); ContentRevision getContentRevision(int i);  }
@Test public void testNames() { Entry left = new DirectoryEntry(-1, "left"); Entry right = new DirectoryEntry(-1, "right"); Difference d = new Difference(false, left, right); DirectoryChangeModel m = createModelOn(d); assertEquals("left", m.getEntryName(0)); assertEquals("right", m.getEntryName(1)); }
@Test public void testNamesForAbsentEntries() { Difference d = new Difference(false, null, null); DirectoryChangeModel m = createModelOn(d); assertEquals("", m.getEntryName(0)); assertEquals("", m.getEntryName(1)); }