_filter(category = this.lastFilter, collection = this.items) {
    const set = this._getFilteredSets(category, collection);

    // Individually add/remove hidden/visible classes
    this._toggleFilterClasses(set);

    // Save the last filter in case elements are appended.
    this.lastFilter = category;

    // This is saved mainly because providing a filter function (like searching)
    // will overwrite the `lastFilter` property every time its called.
    if (typeof category === 'string') {
      this.group = category;
    }

    return set;
  }
Filter the elements by a category.
@param {string|string[]|function(Element):boolean} [category] Category to
    filter by. If it's given, the last category will be used to filter the items.
@param {Array} [collection] Optionally filter a collection. Defaults to
    all the items.
@return {{visible: ShuffleItem[], hidden: ShuffleItem[]}}
@private