private void go( DBObject o , int serialized_len, int transient_fields ) {
byte[] encoded = BSON.encode( o );
assertEquals( serialized_len , encoded.length );
BSONObject read = BSON.decode( encoded );
assertEquals( o.keySet().size() - transient_fields, read.keySet().size() );
if ( transient_fields == 0 )
assertEquals( o , read );
}
@Test