adding tests for the use case examples, and fixing a type in the example code