### Question:
LazyDataModel extends DataModel<E> { @Override public void setRowIndex(int rowIndex) { if (getRowIndex() != rowIndex) { Assert.isTrue(rowIndex >= -1, "RowIndex must not be less than -1"); this.state.setRowIndex(rowIndex); fireDataModelListeners(); } } LazyDataModel(LazyDataLoader<E, S> loader, S state); @Override boolean isRowAvailable(); @Override int getRowCount(); void clearCachedRowCount(); void clearCachedRowCount(int nextRowIndex); @Override E getRowData(); @Override int getRowIndex(); @Override void setRowIndex(int rowIndex); @Override Object getWrappedData(); @Override void setWrappedData(Object o);  }### Answer:
@Test public void shouldNotSupportRowIndexLessThanMinusOne() throws Exception { this.thrown.expect(IllegalArgumentException.class); this.thrown.expectMessage("RowIndex must not be less than -1"); this.dataModel.setRowIndex(-2); }
@Test public void shouldNotDoubleFireListeners() throws Exception { DataModelListener listener = mock(DataModelListener.class); this.dataModel.addDataModelListener(listener); this.dataModel.setRowIndex(0); this.dataModel.setRowIndex(0); verify(listener).rowSelected(this.dataModelEvent.capture()); verifyNoMoreInteractions(listener); }