code: private Object writeMap(SerIterator itemIterator) {
          if (itemIterator.size() == 0) {
              return new LinkedHashMap<>();
          }
          // if key type is known and convertible use short key format, else use full bean format
          if (settings.getConverter().isConvertible(itemIterator.keyType())) {
              return writeMapSimple(itemIterator);
          } else {
              return writeMapComplex(itemIterator);
          }
      }
docs: write map