TableBuilder implements Table { @Override public Table withSomeRows(final Iterable<Long> ids) { Preconditions.checkNotNull(ids); for (Long id : ids) { Preconditions.checkNotNull(id, "each id should not be null"); this.rows.add(Daleq.aRow(id)); } return this; } TableBuilder(final TableTypeReference tableRef); @Override Table with(final Row... rows); @Override Table withSomeRows(final Iterable<Long> ids); @Override Table withSomeRows(final long... ids); @Override Table withRowsBetween(final long from, final long to); @Override Table allHaving(final FieldTypeReference field, @Nullable final Object value); @Override Table having(final FieldTypeReference field, final Object... values); @Override Table havingFrom(final FieldTypeReference field, final Iterable<T> values); @Override TableData build(final Context context);  }
@Test(expected = NullPointerException.class) public void aTableWithSomeNull_should_throw() { final long[] nullArray = null; aTable(ExampleTable.class).withSomeRows(nullArray); }
@Test(expected = NullPointerException.class) public void aTableWithSomeRowsAndOneIsNull_should_throw() { aTable(ExampleTable.class).withSomeRows(1L, 2L, (Long) null); }