@Test
public void getRecordWithMoreThanOneObjectTest() {

    // Setup:
    String newIRI = "http://test.com/record";
    Record recordWithAnotherObject = recordFactory.createNew(vf.createIRI(newIRI));
    recordWithAnotherObject.getModel().add(vf.createIRI("http://test.com/subject"), vf.createIRI("http://test.com/subject"), vf.createLiteral("test"));
    when(catalogManager.getRecord(any(Resource.class), any(Resource.class), any(OrmFactory.class))).thenReturn(Optional.of(recordWithAnotherObject));
    Response response = target().path("catalogs/" + encode(LOCAL_IRI) + "/records/" + encode(newIRI))
            .request().get();
    assertEquals(response.getStatus(), 200);
    verify(catalogManager).getRecord(vf.createIRI(LOCAL_IRI), vf.createIRI(newIRI), recordFactory);
    try {
        ArrayNode arr = (ArrayNode) mapper.readTree(response.readEntity(String.class));
        JsonNode firstRecord = arr.get(0);
        assertTrue(firstRecord.has("@id"));
        assertEquals(firstRecord.get("@id").textValue(), newIRI);
    } catch (Exception e) {
        fail("Expected no exception, but got: " + e.getMessage());
    }
}