EntityMapper extends Mapper<T> { @Nullable @Override public T fromDb(@Nullable final Object dbValue) throws MapperException { assert mapperRegistry != null; assert initialized; if (dbValue == null) { return null; } if (dbValue instanceof DBObject) { final List<MapperError> errors = new LinkedList<>(); final T entity = fromDb((DBObject) dbValue, errors); if (!errors.isEmpty()) { throw new MapperException(errors); } return entity; } throw new MapperException(this, "Nested DBObject expected, got: " + dbValue); }  int getCurrentVersion(); @Nullable @Override T fromDb(@Nullable final Object dbValue); @Nullable T fromDb(@Nonnull final DBObject dbObject, @Nonnull final List<MapperError> errors); void fromDb(@Nonnull final T entity, @Nonnull final DBObject dbObject); @Nonnull @SuppressWarnings("unchecked") T fromDb(
            @Nonnull final T entity,
            @Nonnull final DBObject dbObject,
            @Nonnull final List<MapperError> errors); @Nullable @Override DBObject toDb(@Nullable final T value); @Nonnull DBObject toDb(@Nonnull final T entity, @Nonnull final List<MapperError> errors); void toDb(
            @Nonnull final T entity,
            @Nonnull final DBObject dbObject,
            @Nonnull final List<MapperError> errors); @Nonnull List<SuperEntity> getSuperEntities(); @Nonnull @Override String toString(); boolean isInitialized(); @Nullable final Class<T> getEntityType(); @Nonnull final String getDiscriminator(); @Nonnull List<Field<?>> getFields(); @Nonnull List<Field<?>> getFieldsIncludingSuperEntities(); @Nonnull @SuppressWarnings("unchecked") EntityMapper<T2> getSubMapper(
            @Nonnull final Class<?> entityType);  }
@Test public void testFromDb() throws MapperException { LOG.info("testFromDb"); final DBObject db2 = (DBObject) JSON.parse(JSON_VALUE); final Container container2 = mapper.fromDb(db2); Assert.assertEquals(container1, container2); }