Added predicate example.
Added optional example test.