@Override
  public <T extends ExternalizableGraphElement> void writeGraphElement(@NotNull T elem) throws IOException {
    writeUTF(elem.getClass().getName());
    if (elem instanceof FactoredExternalizableGraphElement) {
      writeGraphElement(((FactoredExternalizableGraphElement<?>)elem).getFactorData());
    }
    elem.write(this);
  }
@Override
  public <T extends ExternalizableGraphElement> void writeGraphElement(@NotNull T elem)