@Test
public void optObjectTest() throws Exception {

    try (RepositoryConnection conn = repo.getConnection()) {
        assertFalse(service.optObject(MISSING_IRI, recordFactory, conn).isPresent());
        assertFalse(service.optObject(EMPTY_IRI, recordFactory, conn).isPresent());
        assertFalse(service.optObject(RANDOM_IRI, recordFactory, conn).isPresent());
        assertFalse(service.optObject(DIFFERENT_IRI, recordFactory, conn).isPresent());
        assertTrue(service.optObject(RECORD_IRI, recordFactory, conn).isPresent());
    }
}