Fix example to contain expectation
Fixes #5449