### Question:
JNLPSwingUtil extends JNLPUtil { public static void loadPartAndCreateDialogForIt( AtlasStatusDialogInterface asg, final String... parts) { try { if (GraphicsEnvironment.isHeadless()) { loadPart(parts, new NoGuiDownloadServiceListener()); return; } boolean edt = SwingUtilities.isEventDispatchThread(); LOGGER.debug("loadPartAndCreateDialogForIt(String[] parts) EDT:" + edt); if (asg == null) { LOGGER.debug( "loadPartAndCreateDialogForIt has been called with null AtlasStatusDialog", new RuntimeException( "loadPartAndCreateDialogForIt has been called with null AtlasStatusDialog")); asg = new AtlasStatusDialog( null, SwingUtil .R("AtlasStatusDialog.jnlp.generalDownload.Title"), SwingUtil .R("AtlasStatusDialog.jnlp.generalDownload.Desc")); } final AtlasStatusDialogInterface finalRefToStatusDialog = asg; final AtlasSwingWorker<Void> asw = new AtlasSwingWorker<Void>( finalRefToStatusDialog) { @Override protected Void doInBackground() throws Exception { loadPart(parts, finalRefToStatusDialog); return null; } }; if (edt) { LOGGER.debug(" starting a AtlasSwingWorker (null) to download on edt"); asw.executeModal(); } else { LOGGER.debug(" starting a AtlasSwingWorker (null) to download not on edt, via Invoke AndWait"); org.geotools.resources.SwingUtilities .invokeAndWait(new Runnable() { @Override public void run() { try { asw.executeModal(); } catch (CancellationException e) { LOGGER.error( "Ex on AtlasStwingWorker for loadPartAndCreateDialogForIt", e); } catch (InterruptedException e) { LOGGER.error( "Ex on AtlasStwingWorker for loadPartAndCreateDialogForIt", e); } catch (ExecutionException e) { LOGGER.error( "Ex on AtlasStwingWorker for loadPartAndCreateDialogForIt", e); } } }); } } catch (Throwable e) { throw new RuntimeException(e); } }  static void loadPart(String[] parts,
			DownloadServiceListener serviceListener); static void loadPartAndCreateDialogForIt(
			AtlasStatusDialogInterface asg, final String... parts);  }### Answer:
@Test public void testLoadPartEvenHeadless() throws IOException { if (TestingUtil.isInteractive()) { JNLPSwingUtil.loadPartAndCreateDialogForIt(null, "a"); AtlasStatusDialog myAsg = new AtlasStatusDialog(null, "my","my"); JNLPSwingUtil.loadPartAndCreateDialogForIt(myAsg, "a"); } }