The documentation found here may be out of date:
From Lauren R:
"Looking at P4, that example code is mostly from 2012, so it's possible that it's out of date. It's pulled directly from the source code, though, so the Jira task should probably go to Core team."
Head over to the existing Questions & Answers thread and let us know what's up.