protected function generateNextPermutation() {
    $number = implode('', $this->mask);
    $result = LexographicalPermutation::getNextPermutation($number);
    if ($result !== FALSE) {
      $this->mask = str_split($result);
    }
    return $result !== FALSE;
  }