void () { final VirtualFile dir = createChildDirectory(myRoot, "dir"); final VirtualFile[] f = new VirtualFile[1]; executeCommand(() -> { f[0] = createChildData(myRoot, "foo.txt"); setDocumentText(f[0], "foo"); }); executeCommand(() -> { move(f[0], dir); setDocumentText(f[0], "foobar"); }); globalUndo(); globalUndo(); assertNull(myRoot.findChild("foo.txt")); globalRedo(); f[0] = myRoot.findChild("foo.txt"); assertNotNull(f[0]); assertEquals("foo", getDocumentText(f[0])); globalRedo(); assertEquals(dir, f[0].getParent()); assertEquals("foobar", getDocumentText(f[0])); }