code: private void split(ArrayList<DistanceSet> pointSet, ArrayList<DistanceSet> farSet, int maxScale) {
          double fmax = getCoverRadius(maxScale);
          ArrayList<DistanceSet> newSet = new ArrayList<>();
          for (int i = 0; i < pointSet.size(); i++) {
              DistanceSet n = pointSet.get(i);
              if (n.dist.get(n.dist.size() - 1) <= fmax) {
                  newSet.add(n);
              } else {
                  farSet.add(n);
              }
          }
  
          pointSet.clear();
          pointSet.addAll(newSet);
      }
docs: Splits a given pointSet into near and far based on the given
  scale/level. All points with distance > base^maxScale would be moved
  to far set. In other words, all those points that are not covered by the
  next child ball of a point p (ball made of the same point p but of
  smaller radius at the next lower level) are removed from the supplied
  current pointSet and put into farSet.
  
  @param pointSet the supplied set from which all far points
  would be removed.
  @param farSet the set in which all far points having distance
  > base^maxScale would be put into.
  @param maxScale the given scale based on which the distances
  of points are judged to be far or near.