@Test
public void testFindDataObjectsByClass() {

    DXRecord record = DXRecord.newRecord().setProject(testProject).setName("arecord").build();
    DXFile file = DXFile.newFile().setProject(testProject).setName("afile").build();
    DXApplet applet =
            DXApplet.newApplet().setProject(testProject).setName("anapplet")
                    .setRunSpecification(RunSpecification.newRunSpec("bash", "", "Ubuntu", "14.04").build())
                    .build();
    DXWorkflow workflow =
            DXWorkflow.newWorkflow().setProject(testProject).setName("aworkflow").build();
    DXRecord recordResult =
            Iterables.getOnlyElement(DXSearch.findDataObjects().inProject(testProject)
                    .withClassRecord().execute().asList());
    Assert.assertEquals(record, recordResult);
    Assert.assertEquals("arecord", recordResult.describe().getName());
    DXFile fileResult =
            Iterables.getOnlyElement(DXSearch.findDataObjects().inProject(testProject)
                    .withClassFile().execute().asList());
    Assert.assertEquals(file, fileResult);
    Assert.assertEquals("afile", fileResult.describe().getName());
    DXApplet appletResult =
            Iterables.getOnlyElement(DXSearch.findDataObjects().inProject(testProject)
                    .withClassApplet().execute().asList());
    Assert.assertEquals(applet, appletResult);
    Assert.assertEquals("anapplet", appletResult.describe().getName());
    DXWorkflow workflowResult =
            Iterables.getOnlyElement(DXSearch.findDataObjects().inProject(testProject)
                    .withClassWorkflow().execute().asList());
    Assert.assertEquals(workflow, workflowResult);
    Assert.assertEquals("aworkflow", workflowResult.describe().getName());
}