SwingXUtilities { public static <T> FutureTask<T> invokeLater(Callable<T> callable) { FutureTask<T> task = new FutureTask<T>(callable); SwingUtilities.invokeLater(task); return task; } private  SwingXUtilities(); static void updateMnemonicBinding(JComponent c, String pressed); static void updateMnemonicBinding(JComponent c, String pressed, String released); static void setComponentTreeEnabled(Component c, boolean enabled); static void setComponentTreeLocale(Component c, Locale locale); static void setComponentTreeBackground(Component c, Color color); static void setComponentTreeForeground(Component c, Color color); static void setComponentTreeFont(Component c, Font font); static void setHtmlFont(HTMLDocument doc, Font font); static void updateAllComponentTreeUIs(); static void updateAllComponentTreeUIs(Window window); static FutureTask<T> invokeLater(Callable<T> callable); static T invokeAndWait(Callable<T> callable); @SuppressWarnings("unchecked") static T getAncestor(Class<T> clazz, Component c); static boolean isDescendingFrom(Component focusOwner, Component parent); static boolean isUIInstallable(Object property); static void setLeadAnchorWithoutSelection(
            ListSelectionModel selectionModel, int lead, int anchor); static boolean shouldIgnore(MouseEvent mouseEvent,
            JComponent component); static int loc2IndexFileList(JList list, Point point); static void adjustFocus(JComponent component); static int convertModifiersToDropAction(int modifiers,
            int sourcActions);  }
@Test public void testInvokeLater() { assertThat(SwingUtilities.isEventDispatchThread(), is(false)); Callable<Void> callable = new Callable<Void>() { @Override public Void call() throws Exception { assertThat(SwingUtilities.isEventDispatchThread(), is(true)); Thread.sleep(1000); return null; } }; long start = System.currentTimeMillis(); FutureTask<Void> task = SwingXUtilities.invokeLater(callable); assertThat((System.currentTimeMillis() - start) < 100, is(true)); }