class BasicDocument extends LinkedHashMap<String, Object> implements MutableDocument {

    @Override
    public MutableDocument clone() {
        BasicDocument clone = new BasicDocument();
        for (Field field : this.fields()) {
            Object value = unwrap(field.getValue());
            if (value instanceof Array) {
                value = ((Array)value).clone();
            } else if (value instanceof Document) {
                value = ((Document)value).clone();
            }// every other kind of value is immutable
            clone.put(field.getName(), value);
        }
        return clone;
    }

    public  BasicDocument();
    public  BasicDocument( Document document );
    public  BasicDocument( int initialCapacity );
    public  BasicDocument( String name,
                          Object value );
    public  BasicDocument( String name1,
                          Object value1,
                          String name2,
                          Object value2 );
    public  BasicDocument( String name1,
                          Object value1,
                          String name2,
                          Object value2,
                          String name3,
                          Object value3 );
    public  BasicDocument( String name1,
                          Object value1,
                          String name2,
                          Object value2,
                          String name3,
                          Object value3,
                          String name4,
                          Object value4 );

}