Added NOT tests
Reproduces NPE issue
Fixes bug and adds runtime exception
Merge branch 'master' into USERGRID-2580
Merge pull request #259 from apigee/USERGRID-2580

Usergrid 2580