code: private void addToTies(int id) {
      if(ties.length == numties) {
        ties = Arrays.copyOf(ties, (ties.length << 1) + 1); // grow.
      }
      ties[numties] = id;
      ++numties;
    }
docs: Ensure the ties array has capacity for at least one more element.
  
  @param id
  Id to add