DXRecord extends DXDataObject { public static DXRecord getInstance(String recordId) { return new DXRecord(recordId, null); } private  DXRecord(String recordId, DXContainer project, DXEnvironment env, JsonNode describe); private  DXRecord(String recordId, DXEnvironment env); static DXRecord getInstance(String recordId); static DXRecord getInstance(String recordId, DXContainer project); static DXRecord getInstanceWithEnvironment(String recordId, DXContainer project,
            DXEnvironment env); static DXRecord getInstanceWithEnvironment(String recordId, DXEnvironment env); static Builder newRecord(); static Builder newRecordWithEnvironment(DXEnvironment env); @Override DXRecord close(); @Override DXRecord closeAndWait(); @Override Describe describe(); @Override Describe describe(DXDataObject.DescribeOptions options); @Override Describe getCachedDescribe();  }
@Test public void testGetInstance() { DXRecord record = DXRecord.getInstance("record-000011112222333344445555"); Assert.assertEquals("record-000011112222333344445555", record.getId()); Assert.assertEquals(null, record.getProject()); DXRecord record2 = DXRecord.getInstance("record-000100020003000400050006", DXProject.getInstance("project-123412341234123412341234")); Assert.assertEquals("record-000100020003000400050006", record2.getId()); Assert.assertEquals("project-123412341234123412341234", record2.getProject().getId()); try { DXRecord.getInstance(null); Assert.fail("Expected creation without setting ID to fail"); } catch (NullPointerException e) { } try { DXRecord.getInstance("record-123412341234123412341234", (DXContainer) null); Assert.fail("Expected creation without setting project to fail"); } catch (NullPointerException e) { } try { DXRecord.getInstance(null, DXProject.getInstance("project-123412341234123412341234")); Assert.fail("Expected creation without setting ID to fail"); } catch (NullPointerException e) { } }