//Create a defect
System.out.println("Creating defect...");
JsonObject newDefect = new JsonObject();
newDefect.addProperty("Name", "Test Defect");
CreateRequest createRequest = new CreateRequest("defect", newDefect);
CreateResponse createResponse = restApi.create(createRequest);
System.out.println(String.format("Created %s", createResponse.getObject().get("_ref").getAsString()));
//Read defect
String ref = Ref.getRelativeRef(createResponse.getObject().get("_ref").getAsString());
System.out.println(String.format("\nReading defect %s...", ref));
GetRequest getRequest = new GetRequest(ref);
GetResponse getResponse = restApi.get(getRequest);
JsonObject obj = getResponse.getObject();
System.out.println(String.format("Read defect. Name = %s, State = %s",