@Test public void verify() throws SQLException { migrator.migrate(); DBCollection collection = migrator.getDb().getCollection("classesIDs"); long count = 0; DateTime begin = DateTime.now(); try (Connection connection = migrator.getConnection(); Statement statement = connection.createStatement(); ResultSet resultSet = statement.executeQuery("select id from classes")) { while (resultSet.next()) { count++; long id = resultSet.getLong("id"); ObjectId objectId = migrator.lookupId("classes", id); JavadocClassCriteria criteria = new JavadocClassCriteria(ds); criteria.id(objectId); Assert.assertNotNull( criteria.query().get(), String.format("Looking for %d => %s", id, objectId)); } } catch (Exception e) { e.printStackTrace(); throw new RuntimeException(e.getMessage(), e); } }