@Test
public void testRoundTripConversion() throws FileNotFoundException, IOException, FactoryException {

    SimpleFeatureType original = buildDummyFeatureType("dummy");
    
    DBObject dbo = FeatureTypeDBObject.convert(original);
    
    // make sure we're dealing with proper BSON/JSON by round-tripping it
    // through serialization...
    StringBuilder jsonBuffer = new StringBuilder();
    JSON.serialize(dbo, jsonBuffer);
    String json = jsonBuffer.toString();
    System.out.println(MongoTestUtil.prettyPrint(json));
    Object o = JSON.parse(json);
    assertThat(o, is(instanceOf(DBObject.class)));
    dbo = (DBObject)o;
    
    SimpleFeatureType result = FeatureTypeDBObject.convert(dbo);
 
    compareFeatureTypes(original, result, false);
}