DXApplet extends DXDataObject implements DXExecutable<DXJob> { public static DXApplet getInstance(String appletId) { return new DXApplet(appletId, null); } private  DXApplet(String appletId, DXContainer project, DXEnvironment env, JsonNode describe); private  DXApplet(String appletId, DXEnvironment env); static DXApplet getInstance(String appletId); static DXApplet getInstance(String appletId, DXContainer project); static DXApplet getInstanceWithEnvironment(String appletId, DXContainer project,
            DXEnvironment env); static DXApplet getInstanceWithEnvironment(String appletId, DXEnvironment env); static Builder newApplet(); static Builder newAppletWithEnvironment(DXEnvironment env); @Override Describe describe(); @Override Describe describe(DXDataObject.DescribeOptions options); @Override Describe getCachedDescribe(); @Override ExecutableRunner<DXJob> newRun();  }
@Test public void testGetInstance() { DXApplet applet = DXApplet.getInstance("applet-000011112222333344445555"); Assert.assertEquals("applet-000011112222333344445555", applet.getId()); Assert.assertEquals(null, applet.getProject()); DXApplet applet2 = DXApplet.getInstance("applet-000100020003000400050006", DXProject.getInstance("project-123412341234123412341234")); Assert.assertEquals("applet-000100020003000400050006", applet2.getId()); Assert.assertEquals("project-123412341234123412341234", applet2.getProject().getId()); try { DXApplet.getInstance(null); Assert.fail("Expected creation without setting ID to fail"); } catch (NullPointerException e) { } try { DXApplet.getInstance("applet-123412341234123412341234", (DXContainer) null); Assert.fail("Expected creation without setting project to fail"); } catch (NullPointerException e) { } try { DXApplet.getInstance(null, DXProject.getInstance("project-123412341234123412341234")); Assert.fail("Expected creation without setting ID to fail"); } catch (NullPointerException e) { } }