code: private void writeMapComplex(SerIterator itemIterator) throws IOException {
          output.writeArrayStart();
          while (itemIterator.hasNext()) {
              itemIterator.next();
              Object key = itemIterator.key();
              if (key == null) {
                  throw new IllegalArgumentException("Unable to write map key as it cannot be null: " + key);
              }
              output.writeArrayItemStart();
              output.writeArrayStart();
              output.writeArrayItemStart();
              writeObject(itemIterator.keyType(), key, null);
              output.writeArrayItemStart();
              writeObject(itemIterator.valueType(), itemIterator.value(), itemIterator);
              output.writeArrayEnd();
          }
          output.writeArrayEnd();
      }
docs: write map with complex keys