code: private Object writeElements(SerIterator itemIterator) {
          if (itemIterator.category() == SerCategory.MAP) {
              return writeMap(itemIterator);
          } else if (itemIterator.category() == SerCategory.COUNTED) {
              return writeCounted(itemIterator);
          } else if (itemIterator.category() == SerCategory.TABLE) {
              return writeTable(itemIterator);
          } else if (itemIterator.category() == SerCategory.GRID) {
              return writeGrid(itemIterator);
          } else {
              return writeArray(itemIterator);
          }
      }
docs: write a collection