// Path: src/main/java/net/seninp/util/SortedArrayList.java
// public class SortedArrayList<T> extends ArrayList<T> {
// 
//   /** The fancy serial. */
//   private static final long serialVersionUID = 291265617765342218L;
// 
//   /**
//    * Inserts an element and sorts the array.
//    * 
//    * @param value the value to insert.
//    */
//   public void insertSorted(T value) {
//     add(value);
//     @SuppressWarnings("unchecked")
//     Comparable<T> cmp = (Comparable<T>) value;
//     for (int i = size() - 1; i > 0 && cmp.compareTo(get(i - 1)) < 0; i--) {
//       Collections.swap(this, i, i - 1);
//     }
//   }
// }


import java.util.Iterator;
import java.util.List;
import net.seninp.util.SortedArrayList;

      else {
        sb.append("discord #" + i + " \"" + record.getPayload() + "\", at " + record.getPosition()
            + " distance to closest neighbor: " + record.getNNDistance() + ", info string: \""
            + record.getInfo() + "\"\n");
      }
    }
    return sb.toString();
  }

  @Override
  public Iterator<DiscordRecord> iterator() {
    return this.discords.iterator();
  }

  /**
   * Get the collection size.
   * 
   * @return the discords collection size.
   */
  public int getSize() {
    return this.discords.size();
  }

  /**
   * Get a discord record by its index.
   * 
   * @param i the index.
   * @return the discord record.
   */
  public DiscordRecord get(int i) {

// Path: src/main/java/net/seninp/util/SortedArrayList.java
// public class SortedArrayList<T> extends ArrayList<T> {
// 
//   /** The fancy serial. */
//   private static final long serialVersionUID = 291265617765342218L;
// 
//   /**
//    * Inserts an element and sorts the array.
//    * 
//    * @param value the value to insert.
//    */
//   public void insertSorted(T value) {
//     add(value);
//     @SuppressWarnings("unchecked")
//     Comparable<T> cmp = (Comparable<T>) value;
//     for (int i = size() - 1; i > 0 && cmp.compareTo(get(i - 1)) < 0; i--) {
//       Collections.swap(this, i, i - 1);
//     }
//   }
// }


// Path: src/main/java/net/seninp/jmotif/sax/discord/DiscordRecords.java
import java.util.Iterator;
import java.util.List;
import net.seninp.util.SortedArrayList;

      else {
        sb.append("discord #" + i + " \"" + record.getPayload() + "\", at " + record.getPosition()
            + " distance to closest neighbor: " + record.getNNDistance() + ", info string: \""
            + record.getInfo() + "\"\n");
      }
    }
    return sb.toString();
  }

  @Override
  public Iterator<DiscordRecord> iterator() {
    return this.discords.iterator();
  }

  /**
   * Get the collection size.
   * 
   * @return the discords collection size.
   */
  public int getSize() {
    return this.discords.size();
  }

  /**
   * Get a discord record by its index.
   * 
   * @param i the index.
   * @return the discord record.
   */
  public DiscordRecord get(int i) {

    return this.discords.get(i);
