code: @Override
      protected void _to(final ObjectOutput out) throws IOException {
          Term[] terms = index(Term.class, indexedTerms);
          // 1: write number of terms
          out.writeInt(terms.length);
          for (int i = 0; i < terms.length; i++) {
              // 1: write each term
              out.writeObject(terms[i]);
          }
          // 2: write number of global terms
          out.writeInt(globalTermIndex.size());
          for (final Entry<Integer, Integer> e : entries(globalTermIndex)) {
              Integer key = e.getKey();
              Integer value = e.getValue();
              // 1: write global term key
              out.writeInt(key);
              // 2: write global term value
              out.writeInt(value);
          }
      }
docs: {@inheritDoc}