void () { Entry dir = new DirectoryEntry("dir"); Entry child1 = new FileEntry("child1", null, -1, false); Entry child2 = new FileEntry("child2", null, -1, false); dir.addChild(child1); dir.addChild(child2); try { child1.setName("child2"); fail(); } catch (RuntimeException e) { } }