@Test public void testPersistentStoreBack() throws Exception { File file = new File(System.getProperty("java.io.tmpdir")); adocEditor.setPersistentStoreBack("test", file); FXPlatform.invokeLater(() -> adocEditor.setText("bla blubb")); Thread.sleep(LastTextChange.WAIT_TIME * 2); activityController.waitForTasks(); List<String> strings = Files.readLines(new File(file, "test"), Charsets.UTF_8); assertEquals(1, strings.size()); adocEditor.removePersistentStoreBack(); FXPlatform.invokeLater(() -> adocEditor.setText("")); Thread.sleep(LastTextChange.WAIT_TIME * 2); activityController.waitForTasks(); adocEditor.setPersistentStoreBack("test", file); FXPlatform.invokeLater(() -> adocEditor.onRefresh(null)); activityController.waitForTasks(); assertEquals("bla blubb\n", adocEditor.getText()); }