RenameChange (RootEntry root, String path, String newName) { Entry e = root.getEntry(path); RenameChange result = new RenameChange(nextId(), Paths.renamed(path, newName), e.getName()); e.setName(newName); return result; }