code: private void removeUnsharedReference(Object obj, int previousHandle) {
          if (previousHandle != -1) {
              objectsWritten.put(obj, previousHandle);
          } else {
              objectsWritten.remove(obj);
          }
      }
docs: Remove the unshared object from the table, and restore any previous
  handle.
  
  @param obj
  Non-null object being dumped.
  @param previousHandle
  The handle of the previous identical object dumped