TableBuilder implements Table { @Override public Table with(final Row... rows) { Preconditions.checkNotNull(rows, "rows should not be null"); for (final Row row : rows) { Preconditions.checkNotNull(row, "each row should not be null"); this.rows.add(row); } 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 aTableWithArrayIsNull_should_fail() { final Row[] nullRows = null; aTable(ExampleTable.class).with(nullRows); }
@Test(expected = NullPointerException.class) public void aTableWithNullRow_should_fail() { aTable(ExampleTable.class).with(aRow(42), null); }