void (String expected) { PlatformTestUtil.waitWhileBusy(myPane.getTree()); TreePath path = PlatformTestUtil.waitForPromise(myPane.promisePathToElement(getContentDirectory())); PlatformTestUtil.waitWhileBusy(myPane.getTree()); Object element = path.getLastPathComponent(); assertNotNull("Element for " + getContentDirectory() + " not found", element); assertEquals(expected.trim(), PlatformTestUtil.print(myPane.getTree(), path, new Queryable.PrintInfo(), false)); }