title: About Source Code: org.bson.Document cannot be cast to com.mongodb.DBObject
body: <p>I have a question.I use Version 2.x, look the source code.the MappingMongoConverter.class :</p>
  
  <pre><code>@Nullable
  private &lt;S&gt; S read(TypeInformation&lt;S&gt; type, @Nullable Bson bson, ObjectPath path) {
      if (null == bson) {
          return null;
      } else {
          TypeInformation&lt;? extends S&gt; typeToUse = this.typeMapper.readType(bson, type);
          Class&lt;? extends S&gt; rawType = typeToUse.getType();
          if (this.conversions.hasCustomReadTarget(bson.getClass(), rawType)) {
              return this.conversionService.convert(bson, rawType);
          } else if (DBObject.class.isAssignableFrom(rawType)) {
              return bson;
          } else if (Document.class.isAssignableFrom(rawType)) {
              return bson;
          } else if (typeToUse.isCollectionLike() &amp;&amp; bson instanceof List) {
              return this.readCollectionOrArray(typeToUse, (List)bson, path);
          } else if (typeToUse.isMap()) {
              return this.readMap(typeToUse, bson, path);
          } else if (bson instanceof Collection) {
              throw new MappingException(String.format("Cannot convert %1$s of type %2$s into an instance of %3$s! Implement a custom Converter&lt;%2$s, %3$s&gt; and register it with the CustomConversions. Parent object was: %4$s", bson, BasicDBList.class, typeToUse.getType(), path));
          } else if (typeToUse.equals(ClassTypeInformation.OBJECT)) {
              return bson;
          } else {
              Document target = bson instanceof BasicDBObject ? new Document((BasicDBObject)bson) : (Document)bson;
              MongoPersistentEntity&lt;?&gt; entity = (MongoPersistentEntity)this.mappingContext.getPersistentEntity(typeToUse);
              if (entity == null) {
                  throw new MappingException(String.format("Expected to read Document %s into type %s but didn't find a PersistentEntity for the latter!", target, typeToUse.getType()));
              } else {
                  return this.read((MongoPersistentEntity)this.mappingContext.getRequiredPersistentEntity(typeToUse), target, path);
              }
          }
      }
  }
  </code></pre>
  
  <p>this line:</p>
  
  <pre><code>else if (DBObject.class.isAssignableFrom(rawType)) {
              return bson;
          }
  </code></pre>
  
  <p>when i try to converter the response to DBObject,this is return bson.class(Document.class),For exanple:</p>
  
  <pre><code>List&lt;DBObject&gt; userList = mongoTemplate.findAll(DBObject.class, "user_info");
  </code></pre>
  
  <p>the "userList" element is Document.class  Actually。 so,when execute this code:</p>
  
  <pre><code>DBObject obj = userList.get(1)
  </code></pre>
  
  <p>this is a problem: "org.bson.Document cannot be cast to com.mongodb.DBObject."</p>
  
  <p>is it right? why i execute: mongoTemplate.findAll(DBObject.class, "user_info") ,i will take the Document.class of List? not DBObject.class of List?</p>