Add Document->hasId test to complete coverage for pull request #308