docs: private Object toReference(int type, Object referent, int hash)
      {
          switch (type)
          {
              case HARD:
                  return referent;
              case SOFT:
                  return new SoftRef(hash, referent, queue);
              case WEAK:
                  return new WeakRef(hash, referent, queue);
              default:
                  throw new Error();
          }
      }