You should not rely on examples in the documentation to be 100% executable without any changes. Often documentation shows examples that you can get ideas from to implement your own implementations and show the API for you to learn. You should probably look at https://github.com/droolsjbpm/jbpm/tree/master/jbpm-workitems/src/main/java/org/jbpm/process/workitem/email for an implementation of the email handler.
Hope this helps.