Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package com.j256.ormlite.stmt;
  
  import static org.junit.Assert.assertEquals;
  import static org.junit.Assert.assertFalse;
  import static org.junit.Assert.assertNotNull;
  import static org.junit.Assert.assertNull;
  import static org.junit.Assert.assertTrue;
  import static org.junit.Assert.fail;
  
 import java.util.List;
 import java.util.Set;
 
 import org.junit.Test;
 
 
 public class JdbcQueryBuilderTest extends BaseJdbcTest {
 
 	private final static String ID_PREFIX = "id";
 	private final static int LOW_VAL = 21114;
 	private final static int HIGH_VAL =  + 499494;
 	private final static int EQUAL_VAL = 21312312;
 	private Foo foo1;
 	private Foo foo2;
 
 	@Test
 	@SuppressWarnings("unchecked")
 	public void testAnd() throws Exception {
 		Dao<FooStringfooDao = createTestData();
 		QueryBuilder<FooStringqb = fooDao.queryBuilder();
 
 		// test And + Eq
 		List<Fooresults = fooDao.query(qb.prepare());
 		assertEquals(1, results.size());
 		assertEquals(results.get(0));
 
 		// test And + Eq not inline
 		Where<FooStringwhere = qb.where();
 		where.and();
 		results = fooDao.query(qb.prepare());
 		assertEquals(1, results.size());
 		assertEquals(results.get(0));
 
 		// test And double args
 		where = qb.where();
 		where.and(where.eq(..), where.eq(..));
 		results = fooDao.query(qb.prepare());
 		assertEquals(1, results.size());
 		assertEquals(results.get(0));
 	}
 
 	@Test
 	@SuppressWarnings("unchecked")
 	public void testOr() throws Exception {
 		Dao<FooStringfooDao = createTestData();
 		QueryBuilder<FooStringqb = fooDao.queryBuilder();
 
 		// test Or + Eq
 		List<Fooresults = fooDao.query(qb.prepare());
 		assertEquals(1, results.size());
 		assertEquals(results.get(0));
 
 		// test Or + Eq not inline
 		Where<FooStringwhere = qb.where();
 		where.or();
 		results = fooDao.query(qb.prepare());
 		assertEquals(1, results.size());
 		assertEquals(results.get(0));
 
 		// test Or of ands
 		where = qb.where();
 		where.or(where.and(where.eq(..), where.eq(..)),
 		results = fooDao.query(qb.prepare());
 		assertEquals(2, results.size());
 		assertEquals(results.get(0));
 		assertEquals(results.get(1));
 	}
 
 	@Test
 	public void testSelectArgs() throws Exception {
 		Dao<FooStringfooDao = createTestData();
 		QueryBuilder<FooStringqb = fooDao.queryBuilder();
 
 		SelectArg idSelectArg = new SelectArg();
 		qb.where().eq(.idSelectArg);
		PreparedQuery<FoopreparedQuery = qb.prepare();
		idSelectArg.setValue(.);
		List<Fooresults = fooDao.query(preparedQuery);
		assertEquals(1, results.size());
		assertEquals(results.get(0));
		idSelectArg.setValue(.);
		results = fooDao.query(qb.prepare());
		assertEquals(1, results.size());
		assertEquals(results.get(0));
	}
	public void testLike() throws Exception {
		Dao<FooStringfooDao = createTestData();
		QueryBuilder<FooStringqb = fooDao.queryBuilder();
		List<Fooresults = fooDao.query(qb.prepare());
		assertEquals(2, results.size());
		assertEquals(results.get(0));
		assertEquals(results.get(1));
	}
	public void testSelectArgsNotSet() throws Exception {
		Dao<FooStringfooDao = createTestData();
		QueryBuilder<FooStringqb = fooDao.queryBuilder();
		SelectArg idSelectArg = new SelectArg();
		qb.where().eq(.idSelectArg);
		try {
			fooDao.query(qb.prepare());
			fail("expected exception");
catch (SQLException e) {
			// expected
			..println("Expected: " + e);
		}
	}
	public void testSelectNot() throws Exception {
		Dao<FooStringfooDao = createTestData();
		QueryBuilder<FooStringqb = fooDao.queryBuilder();
		List<Fooresults = fooDao.query(qb.prepare());
		assertEquals(1, results.size());
		assertEquals(results.get(0));
	}
	public void testIn() throws Exception {
		Dao<FooStringfooDao = createTestData();
		QueryBuilder<FooStringqb = fooDao.queryBuilder();
		List<Fooresults = fooDao.query(qb.prepare());
		assertEquals(2, results.size());
		assertEquals(results.get(0));
		assertEquals(results.get(1));
	}
	public void testInIterable() throws Exception {
		Dao<FooStringfooDao = createTestData();
		QueryBuilder<FooStringqb = fooDao.queryBuilder();
		List<Fooresults = fooDao.query(qb.prepare());
		assertEquals(2, results.size());
		assertEquals(results.get(0));
		assertEquals(results.get(1));
	}
	public void testExists() throws Exception {
		Dao<FooStringfooDao = createTestData();
		QueryBuilder<FooStringinnerQb = fooDao.queryBuilder();
		innerQb.where().idEq(.);
		QueryBuilder<FooStringqb = fooDao.queryBuilder();
		qb.where().exists(innerQb);
		List<Fooresults = fooDao.query(qb.prepare());
		assertEquals(2, results.size());
		assertEquals(results.get(0));
		assertEquals(results.get(1));
	}
	public void testExistsNoEntries() throws Exception {
		Dao<FooStringfooDao = createTestData();
		QueryBuilder<FooStringinnerQb = fooDao.queryBuilder();
		innerQb.where().idEq("no id by this name");
		QueryBuilder<FooStringqb = fooDao.queryBuilder();
		qb.where().exists(innerQb);
		List<Fooresults = fooDao.query(qb.prepare());
		assertEquals(0, results.size());
	}
	public void testNotExists() throws Exception {
		Dao<FooStringfooDao = createTestData();
		QueryBuilder<FooStringinnerQb = fooDao.queryBuilder();
		innerQb.where().idEq(.);
		QueryBuilder<FooStringqb = fooDao.queryBuilder();
		qb.where().not().exists(innerQb);
		List<Fooresults = fooDao.query(qb.prepare());
		assertEquals(0, results.size());
	}
	public void testNotIn() throws Exception {
		Dao<FooStringfooDao = createTestData();
		QueryBuilder<FooStringqb = fooDao.queryBuilder();
		List<Fooresults = fooDao.query(qb.prepare());
		assertEquals(1, results.size());
		assertEquals(results.get(0));
	}
	public void testNotBad() throws Exception {
		Dao<FooStringfooDao = createTestData();
		QueryBuilder<FooStringqb = fooDao.queryBuilder();
		qb.where().not();
		try {
			fooDao.query(qb.prepare());
			fail("expected exception");
catch (IllegalStateException e) {
			// expected
		}
	}
	@SuppressWarnings("unchecked")
	public void testNotNotComparison() throws Exception {
		Dao<FooStringfooDao = createTestData();
		QueryBuilder<FooStringqb = fooDao.queryBuilder();
		Where<FooStringwhere = qb.where();
		try {
			where.not(where.and(where.eq(..), where.eq(..)));
			fail("expected exception");
catch (IllegalArgumentException e) {
			// expected
		}
	}
	public void testNotArg() throws Exception {
		Dao<FooStringfooDao = createTestData();
		QueryBuilder<FooStringqb = fooDao.queryBuilder();
		Where<FooStringwhere = qb.where();
		where.not(where.eq(..));
		List<Fooresults = fooDao.query(qb.prepare());
		assertEquals(1, results.size());
		assertEquals(results.get(0));
	}
	public void testNoWhereOperations() throws Exception {
		Dao<FooStringfooDao = createTestData();
		QueryBuilder<FooStringqb = fooDao.queryBuilder();
		qb.where();
		try {
			fooDao.query(qb.prepare());
			fail("expected exception");
catch (IllegalStateException e) {
			// expected
		}
	}
	public void testMissingAnd() throws Exception {
		Dao<FooStringfooDao = createTestData();
		QueryBuilder<FooStringqb = fooDao.queryBuilder();
		try {
			fooDao.query(qb.prepare());
			fail("expected exception");
catch (IllegalStateException e) {
			// expected
		}
	}
	public void testMissingAndArg() throws Exception {
		Dao<FooStringfooDao = createDao(Foo.classfalse);
		QueryBuilder<FooStringqb = fooDao.queryBuilder();
		try {
			qb.where().and();
			fail("expected exception");
catch (IllegalStateException e) {
			// expected
		}
	}
	public void testBetween() throws Exception {
		Dao<FooStringfooDao = createTestData();
		QueryBuilder<FooStringqb = fooDao.queryBuilder();
		List<Fooresults = fooDao.query(qb.prepare());
		assertEquals(2, results.size());
		assertEquals(results.get(0));
		assertEquals(results.get(1));
		results = fooDao.query(qb.prepare());
		assertEquals(1, results.size());
		assertEquals(results.get(0));
		results = fooDao.query(qb.prepare());
		assertEquals(1, results.size());
		assertEquals(results.get(0));
		results = fooDao.query(qb.prepare());
		assertEquals(0, results.size());
	}
	public void testBetweenSelectArg() throws Exception {
		Dao<FooStringfooDao = createTestData();
		QueryBuilder<FooStringqb = fooDao.queryBuilder();
		SelectArg lowSelectArg = new SelectArg();
		qb.where().between(.lowSelectArg);
		lowSelectArg.setValue();
		List<Fooresults = fooDao.query(qb.prepare());
		assertEquals(2, results.size());
		assertEquals(results.get(0));
		assertEquals(results.get(1));
		SelectArg highSelectArg = new SelectArg();
		lowSelectArg.setValue( + 1);
		highSelectArg.setValue();
		qb.where().between(.lowSelectArghighSelectArg);
		results = fooDao.query(qb.prepare());
		assertEquals(1, results.size());
		assertEquals(results.get(0));
	}
	public void testBetweenStrings() throws Exception {
		Dao<FooStringfooDao = createTestData();
		QueryBuilder<FooStringqb = fooDao.queryBuilder();
		String low = ;
		String high =  + "99999";
		qb.where().between(.lowhigh);
		List<Fooresults = fooDao.query(qb.prepare());
		assertEquals(2, results.size());
		assertEquals(results.get(0));
		assertEquals(results.get(1));
	}
	public void testLtGtEtc() throws Exception {
		Dao<FooStringfooDao = createTestData();
		QueryBuilder<FooStringqb = fooDao.queryBuilder();
		List<Fooresults = fooDao.query(qb.prepare());
		assertEquals(1, results.size());
		assertEquals(results.get(0));
		results = fooDao.query(qb.prepare());
		assertEquals(2, results.size());
		assertEquals(results.get(0));
		assertEquals(results.get(1));
		results = fooDao.query(qb.prepare());
		assertEquals(2, results.size());
		assertEquals(results.get(0));
		assertEquals(results.get(1));
		results = fooDao.query(qb.prepare());
		assertEquals(1, results.size());
		assertEquals(results.get(0));
		results = fooDao.query(qb.prepare());
		assertEquals(1, results.size());
		assertEquals(results.get(0));
		results = fooDao.query(qb.prepare());
		assertEquals(2, results.size());
		assertEquals(results.get(0));
		assertEquals(results.get(1));
		results = fooDao.query(qb.prepare());
		assertEquals(0, results.size());
		results = fooDao.query(qb.prepare());
		assertEquals(1, results.size());
		assertEquals(results.get(0));
		results = fooDao.query(qb.prepare());
		assertEquals(0, results.size());
		results = fooDao.query(qb.prepare());
		assertEquals(0, results.size());
		results = fooDao.query(qb.prepare());
		assertEquals(1, results.size());
		assertEquals(results.get(0));
		results = fooDao.query(qb.prepare());
		assertEquals(1, results.size());
		assertEquals(results.get(0));
		results = fooDao.query(qb.prepare());
		assertEquals(0, results.size());
	}
	public void testPartialQueryAllRetrieval() throws Exception {
		Dao<PartialDataIntegerpartialDao = createDao(PartialData.classtrue);
		List<Stringfirsts = new ArrayList<String>();
		List<Stringlasts = new ArrayList<String>();
		List<Integerids = new ArrayList<Integer>();
		createPartial(partialDaoidsfirstslasts"bill""rambo");
		createPartial(partialDaoidsfirstslasts"zippy""dingo");
		createPartial(partialDaoidsfirstslasts"crappy""bladdero");
		checkPartialList(partialDao.queryForAll(), idsfirstslastsfalsefalse);
		Set<StringcolumnNames = new HashSet<String>();
		qb.selectColumns(columnNames);
		List<PartialDatapartialList = partialDao.query(qb.prepare());
		checkPartialList(partialListidsfirstslaststruetrue);
		columnNames = new HashSet<String>();
		qb.selectColumns(columnNames);
		partialList = partialDao.query(qb.prepare());
		checkPartialList(partialListidsfirstslastsfalsetrue);
		columnNames = new HashSet<String>();
		qb.selectColumns(columnNames);
		partialList = partialDao.query(qb.prepare());
		checkPartialList(partialListidsfirstslastsfalsefalse);
		for (PartialData partialData : partialDao) {
			assertEquals(1, partialDao.delete(partialData));
		}
		assertEquals(0, partialDao.queryForAll().size());
	}
	public void testPartialIteratorRetrieval() throws Exception {
		Dao<PartialDataIntegerpartialDao = createDao(PartialData.classtrue);
		List<Stringfirsts = new ArrayList<String>();
		List<Stringlasts = new ArrayList<String>();
		List<Integerids = new ArrayList<Integer>();
		createPartial(partialDaoidsfirstslasts"bill""rambo");
		createPartial(partialDaoidsfirstslasts"zippy""dingo");
		createPartial(partialDaoidsfirstslasts"crappy""bladdero");
		checkPartialList(partialDao.queryForAll(), idsfirstslastsfalsefalse);
		checkPartialIterator(partialDao.iterator(), idsfirstslastsfalsefalse);
		Set<StringcolumnNames = new HashSet<String>();
		qb.selectColumns(columnNames);
		Iterator<PartialDataiterator = partialDao.iterator(qb.prepare());
		checkPartialIterator(iteratoridsfirstslaststruetrue);
		columnNames = new HashSet<String>();
		qb.selectColumns(columnNames);
		iterator = partialDao.iterator(qb.prepare());
		checkPartialIterator(iteratoridsfirstslastsfalsetrue);
		columnNames = new HashSet<String>();
		qb.selectColumns(columnNames);
		iterator = partialDao.iterator(qb.prepare());
		checkPartialIterator(iteratoridsfirstslastsfalsefalse);
		for (PartialData partialData : partialDao) {
			assertEquals(1, partialDao.delete(partialData));
		}
		assertEquals(0, partialDao.queryForAll().size());
	}
	public void testIteratorCustomQuery() throws Exception {
		Dao<PartialDataIntegerpartialDao = createDao(PartialData.classtrue);
		List<Stringfirsts = new ArrayList<String>();
		List<Stringlasts = new ArrayList<String>();
		List<Integerids = new ArrayList<Integer>();
		String firstFirst = "bill";
		createPartial(partialDaoidsfirstslastsfirstFirst"rambo");
		createPartial(partialDaoidsfirstslasts"zippy""dingo");
		createPartial(partialDaoidsfirstslasts"crappy""bladdero");
		checkPartialList(partialDao.queryForAll(), idsfirstslastsfalsefalse);
		checkPartialIterator(partialDao.iterator(), idsfirstslastsfalsefalse);
		Iterator<PartialDataiterator = partialDao.iterator(qb.prepare());
		assertTrue(iterator.hasNext());
		assertEquals(firstFirstiterator.next().);
		assertFalse(iterator.hasNext());
		SelectArg firstArg = new SelectArg();
		firstArg.setValue(firstFirst);
		iterator = partialDao.iterator(qb.prepare());
		assertTrue(iterator.hasNext());
		assertEquals(firstFirstiterator.next().);
		assertFalse(iterator.hasNext());
	}
	public void testUnknownColumn() throws Exception {
		Dao<FooStringfooDao = createDao(Foo.classfalse);
		QueryBuilder<FooStringqb = fooDao.queryBuilder();
		try {
			qb.selectColumns("unknown column");
			fail("expected exception");
catch (IllegalArgumentException e) {
			// expected
		}
	}
	public void testOrderBy() throws Exception {
		Dao<FooStringfooDao = createTestData();
		QueryBuilder<FooStringqb = fooDao.queryBuilder();
		List<Fooresults = fooDao.query(qb.prepare());
		assertEquals(2, results.size());
		assertEquals(results.get(0));
		assertEquals(results.get(1));
		qb = fooDao.queryBuilder();;
		results = fooDao.query(qb.prepare());
		assertEquals(2, results.size());
		assertEquals(results.get(0));
		assertEquals(results.get(1));
		// should be the same order
		qb = fooDao.queryBuilder();;
		results = fooDao.query(qb.prepare());
		assertEquals(2, results.size());
		assertEquals(results.get(0));
		assertEquals(results.get(1));
	}
	public void testGroupBy() throws Exception {
		Dao<FooStringfooDao = createTestData();
		QueryBuilder<FooStringqb = fooDao.queryBuilder();
		List<Fooresults = fooDao.query(qb.prepare());
		assertEquals(1, results.size());
		assertNull(results.get(0).);
	}
	public void testGroupAndOrderBy() throws Exception {
		Dao<FooStringfooDao = createTestData();
		QueryBuilder<FooStringqb = fooDao.queryBuilder();
		// get strange order otherwise
		List<Fooresults = fooDao.query(qb.prepare());
		assertEquals(2, results.size());
		assertEquals(results.get(0));
		assertEquals(results.get(1));
	}
	public void testLimit() throws Exception {
		Dao<FooStringfooDao = createTestData();
		QueryBuilder<FooStringqb = fooDao.queryBuilder();
		// no limit the default
		List<Fooresults = fooDao.query(qb.prepare());
		assertEquals(2, results.size());
		assertEquals(results.get(0));
		assertEquals(results.get(1));
		qb.limit(1);
		results = fooDao.query(qb.prepare());
		assertEquals(1, results.size());
		assertEquals(results.get(0));
		// set back to no-limit
		qb.limit(null);
		results = fooDao.query(qb.prepare());
		assertEquals(2, results.size());
		assertEquals(results.get(0));
		assertEquals(results.get(1));
	}
	public void testLimitDoublePrepare() throws Exception {
		Dao<FooStringfooDao = createTestData();
		QueryBuilder<FooStringqb = fooDao.queryBuilder();
		// no limit the default
		List<Fooresults = fooDao.query(qb.prepare());
		assertEquals(2, results.size());
		assertEquals(results.get(0));
		assertEquals(results.get(1));
		qb.limit(1);
		results = fooDao.query(qb.prepare());
		assertEquals(1, results.size());
		assertEquals(results.get(0));
		results = fooDao.query(qb.prepare());
		assertEquals(1, results.size());
		assertEquals(results.get(0));
	}
	public void testLimitAfterSelect() throws Exception {
		Dao<FooStringfooDao = createTestData();
		QueryBuilder<FooStringqb = fooDao.queryBuilder();
		// no limit the default
		List<Fooresults = fooDao.query(qb.prepare());
		assertEquals(2, results.size());
		assertEquals(results.get(0));
		assertEquals(results.get(1));
		qb.limit(1);
		results = fooDao.query(qb.prepare());
		assertEquals(1, results.size());
		assertEquals(results.get(0));
		// set back to no-limit
		qb.limit(null);
		results = fooDao.query(qb.prepare());
		assertEquals(2, results.size());
		assertEquals(results.get(0));
		assertEquals(results.get(1));
	}
	public void testOffsetWithLimit() throws Exception {
		Dao<FooObjectdao = createDao(Foo.classtrue);
		Foo foo1 = new Foo();
		foo1.id = "stuff1";
		assertEquals(1, dao.create(foo1));
		Foo foo2 = new Foo();
		foo2.id = "stuff2";
		assertEquals(1, dao.create(foo2));
		int offset = 1;
		int limit = 2;
		qb.offset(offset);
		qb.limit(limit);
		List<Fooresults = dao.query(qb.prepare());
		assertEquals(1, results.size());
	}
	public void testOffsetNoLimit() throws Exception {
		Dao<FooObjectdao = createDao(Foo.classtrue);
		Foo foo1 = new Foo();
		foo1.id = "stuff1";
		assertEquals(1, dao.create(foo1));
		Foo foo2 = new Foo();
		foo2.id = "stuff2";
		assertEquals(1, dao.create(foo2));
		int offset = 1;
		qb.offset(offset);
		try {
			dao.query(qb.prepare());
			fail("expected exception");
catch (SQLException e) {
			// expected
		}
	}
	public void testReturnId() throws Exception {
		Dao<FooStringfooDao = createTestData();
		QueryBuilder<FooStringqb = fooDao.queryBuilder();
		List<Fooresults = fooDao.query(qb.prepare());
		assertEquals(2, results.size());
		assertEquals(.results.get(0).);
		assertEquals(0, results.get(0).);
		assertEquals(.results.get(1).);
		assertEquals(0, results.get(1).);
	}
	public void testDistinct() throws Exception {
		Dao<FooStringfooDao = createTestData();
		QueryBuilder<FooStringqb = fooDao.queryBuilder();
		List<Fooresults = fooDao.query(qb.prepare());
		assertEquals(1, results.size());
		assertNull(results.get(0).);
	}
	public void testIsNull() throws Exception {
		Dao<FooStringfooDao = createTestData();
		QueryBuilder<FooStringqb = fooDao.queryBuilder();
		// null fields start off as null so 0 are not-null
		List<Fooresults = fooDao.query(qb.prepare());
		assertEquals(0, results.size());
		// all are null
		results = fooDao.query(qb.prepare());
		assertEquals(2, results.size());
		assertEquals(results.get(0));
		assertEquals(results.get(1));
		// set the null fields to not-null
		for (Foo foo : results) {
			foo.nullField = "not null";
			assertEquals(1, fooDao.update(foo));
		}
		// no null results should be found
		results = fooDao.query(qb.prepare());
		assertEquals(0, results.size());
		// all are not-null
		results = fooDao.query(qb.prepare());
		assertEquals(2, results.size());
		assertEquals(results.get(0));
		assertEquals(results.get(1));
	}
	public void testSetWhere() throws Exception {
		Dao<FooStringfooDao = createTestData();
		QueryBuilder<FooStringqb = fooDao.queryBuilder();
		Where<FooStringwhere = qb.where();
		List<Foolist = fooDao.query(qb.prepare());
		assertEquals(1, list.size());
		assertEquals(list.get(0));
		qb = fooDao.queryBuilder();
		qb.setWhere(where);
		list = fooDao.query(qb.prepare());
		assertEquals(1, list.size());
		assertEquals(list.get(0));
	}
	public void testQueryForStringInt() throws Exception {
		Dao<FooStringfooDao = createTestData();
		QueryBuilder<FooStringqb = fooDao.queryBuilder();
		Where<FooStringwhere = qb.where();
		// testing the val column with a integer as a string
		List<Foolist = fooDao.query(qb.prepare());
		assertEquals(1, list.size());
		assertEquals(list.get(0));
	}
	public void testWherePrepare() throws Exception {
		Dao<FooStringfooDao = createTestData();
		List<Fooresults =
				fooDao.query(fooDao.queryBuilder()
						.and()
		assertEquals(1, results.size());
		assertEquals(results.get(0));
	}
	public void testIdEq() throws Exception {
		Dao<FooIntegerfooDao = createDao(Foo.classtrue);
		Foo foo = new Foo();
		foo.id = "wow id wow";
		assertEquals(1, fooDao.create(foo));
		List<Fooresults = fooDao.query(fooDao.queryBuilder().where().idEq(fooDaofoo).prepare());
		assertEquals(1, results.size());
		assertEquals(foo.idresults.get(0).);
	}
	/* ============================================================== */
	protected void checkPartialIterator(Iterator<PartialDataiteratorList<IntegeridsList<Stringfirsts,
			List<Stringlastsboolean firstNullboolean lastNull) {
		int i = 0;
		while (iterator.hasNext()) {
			PartialData partialData = iterator.next();
			checkPartial(partialDataidsfirstslastsifirstNulllastNull);
			i++;
		}
	}
	protected void createPartial(Dao<PartialDataIntegerpartialDaoList<IntegeridsList<Stringfirsts,
			List<StringlastsString firstString lastthrows SQLException {
		PartialData partial = new PartialData();
		partial.first = first;
		partial.last = last;
		partialDao.create(partial);
		ids.add(partial.id);
		firsts.add(partial.first);
		lasts.add(partial.last);
		checkPartial(partialDao.queryForId(partial.id), idsfirstslastsids.size() - 1, falsefalse);
	}
	protected void checkPartialList(List<PartialDatapartialListList<IntegeridsList<Stringfirsts,
			List<Stringlastsboolean firstNullboolean lastNull) {
		assertEquals(partialList.size(), ids.size());
		for (int i = 0; i < partialList.size(); i++) {
			PartialData partial = partialList.get(i);
			assertEquals((intids.get(i), partial.id);
			if (firstNull) {
				assertNull(partial.first);
else {
				assertEquals(partial.firstfirsts.get(i));
			}
			if (lastNull) {
				assertNull(partial.last);
else {