void swap(int first, int second) { if ((this).isNotEmpty) { final temp = this[first]; this[first] = this[second]; this[second] = temp; } }