catch ( IllegalArgumentException ieE ) {
encodeFailed = true;
}
assertTrue( encodeFailed);
// Reset the buffer
buf.seekStart();
assertTrue( tf.transform( td ) instanceof java.util.Date );
BSON.addEncodingHook( TestDate.class, tf );
e.putObject( o );
e.done();