private final void addToTies(int id){
  if (ties.length == numties) {
    ties=Arrays.copyOf(ties,(ties.length << 1) + 1);
  }
  ties[numties]=id;
  ++numties;
}

private final void addToTies ( int id ) { if ( ties . length == numties ) { ties = Arrays . copyOf ( ties , ( ties . length << 1 ) + 1 ) ; } ties [ numties ] = id ; ++ numties ; }
ensure the ties array has capacity for at least one more element .
