@Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;

    Task task = (Task) o;

    if (id != null ? !id.equals(task.id) : task.id != null) return false;
    if (_id != null ? !_id.equals(task._id) : task._id != null) return false;
    if (name != null ? !name.equals(task.name) : task.name != null) return false;
    if (description != null ? !description.equals(task.description) : task.description != null)
      return false;
    return !(label != null ? !label.equals(task.label) : task.label != null);
  }
 /*
  * Folds duplicate entries. Two elements are considered as a pair of
  * duplicates if they coiincide in the rendered string and image. @return
  * returns the number of elements after folding.
  */
 private int fold() {
   if (fAllowDuplicates) {
     for (int i = 0; i != fFilteredCount; i++) {
       fFoldedIndices[i] = i; // identity mapping
     }
     return fFilteredCount;
   }
   int k = 0;
   Label last = null;
   for (int i = 0; i != fFilteredCount; i++) {
     int j = fFilteredIndices[i];
     Label current = fLabels[j];
     if (!current.equals(last)) {
       fFoldedIndices[k] = i;
       k++;
       last = current;
     }
   }
   return k;
 }