Fixes to pull request #16244

- Moved examples for permutations and next into trait definition.