### Question:
TupleRecord implements DBWritable { public void write( PreparedStatement statement ) throws SQLException { for( int i = 0; i < tuple.size(); i++ ) statement.setObject( i + 1, tuple.getObject( i ) ); } TupleRecord();  TupleRecord( Tuple tuple ); void setTuple( Tuple tuple ); Tuple getTuple(); void write( PreparedStatement statement ); void readFields( ResultSet resultSet );  }### Answer:
@Test public void testWrite() throws SQLException { Tuple t = new Tuple( "one", "two", "three" ); PreparedStatement stmt = mock( PreparedStatement.class ); TupleRecord tupleRecord = new TupleRecord( t ); tupleRecord.write( stmt ); verify( stmt ).setObject( 1, "one" ); verify( stmt ).setObject( 2, "two" ); verify( stmt ).setObject( 3, "three" ); verifyNoMoreInteractions( stmt ); }