DXWorkflow extends DXDataObject implements DXExecutable<DXAnalysis> { public static DXWorkflow getInstance(String workflowId) { return new DXWorkflow(workflowId, null); } private  DXWorkflow(String workflowId, DXContainer project, DXEnvironment env, JsonNode describe); private  DXWorkflow(String workflowId, DXEnvironment env); static DXWorkflow getInstance(String workflowId); static DXWorkflow getInstance(String workflowId, DXContainer project); static DXWorkflow getInstanceWithEnvironment(String workflowId, DXContainer project,
            DXEnvironment env); static DXWorkflow getInstanceWithEnvironment(String workflowId, DXEnvironment env); static Builder newWorkflow(); static Builder newWorkflowWithEnvironment(DXEnvironment env); @Override DXWorkflow close(); @Override DXWorkflow closeAndWait(); @Override Describe describe(); @Override Describe describe(DescribeOptions options); @Override Describe getCachedDescribe(); @Override ExecutableRunner<DXAnalysis> newRun(); Modification<Stage> addStage(DXApplet applet,
                                        String name,
                                        Object stageInputs,
                                        int editVersion);  }
@Test public void testGetInstance() { DXWorkflow workflow = DXWorkflow.getInstance("workflow-000011112222333344445555"); Assert.assertEquals("workflow-000011112222333344445555", workflow.getId()); Assert.assertEquals(null, workflow.getProject()); DXWorkflow workflow2 = DXWorkflow.getInstance("workflow-000100020003000400050006", DXProject.getInstance("project-123412341234123412341234")); Assert.assertEquals("workflow-000100020003000400050006", workflow2.getId()); Assert.assertEquals("project-123412341234123412341234", workflow2.getProject().getId()); try { DXWorkflow.getInstance(null); Assert.fail("Expected creation without setting ID to fail"); } catch (NullPointerException e) { } try { DXWorkflow.getInstance("workflow-123412341234123412341234", (DXContainer) null); Assert.fail("Expected creation without setting project to fail"); } catch (NullPointerException e) { } try { DXWorkflow.getInstance(null, DXProject.getInstance("project-123412341234123412341234")); Assert.fail("Expected creation without setting ID to fail"); } catch (NullPointerException e) { } }