code: private ArrayList<String[]> findCluster(Cluster cluster, double cutDist, int minPatternPerCls) {
  
      ArrayList<String[]> clusterTSIdx = new ArrayList<String[]>();
  
      if (cluster.getDistance() != null) {
        // if (cluster.getDistance() > cutDist) {
        if (cluster.getDistanceValue() > cutDist) {
          if (cluster.getChildren().size() > 0) {
            clusterTSIdx.addAll(findCluster(cluster.getChildren().get(0), cutDist, minPatternPerCls));
            clusterTSIdx.addAll(findCluster(cluster.getChildren().get(1), cutDist, minPatternPerCls));
          }
        }
        else {
          // String[] idxes = cluster.getName().split("&");
          ArrayList<String> itemsInCluster = getNameInCluster(cluster);
          String[] idxes = itemsInCluster.toArray(new String[itemsInCluster.size()]);
          if (idxes.length > minPatternPerCls) {
            clusterTSIdx.add(idxes);
          }
        }
      }
  
      return clusterTSIdx;
    }
docs: Finds clusters.
  
  @param cluster the Cluster.
  @param cutDist the cut distance threshold.
  @param minPatternPerCls the minimal patterns threshold.
  @return the clusters.