code: public synchronized OtpErlangRef createRef() {
          final OtpErlangRef r = new OtpErlangRef(node, refId, creation);
  
          // increment ref ids (3 ints: 18 + 32 + 32 bits)
          refId[0]++;
          if (refId[0] > 0x3ffff) {
              refId[0] = 0;
  
              refId[1]++;
              if (refId[1] == 0) {
                  refId[2]++;
              }
          }
  
          return r;
      }
docs: Create an Erlang {@link OtpErlangRef reference}. Erlang references are
  based upon some node specific information; this method creates a
  reference using the information in this node. Each call to this method
  produces a unique reference.
  
  @return an Erlang reference.