Fixed JERSEY-1637 (reopened).

- fixed use cases omitted earlier.
- added more test coverage.

Change-Id: I23d51a8d9353787709d385898a9dce3b120584fd
Signed-off-by: Marek Potociar <marek.potociar@oracle.com>
Merge "Fixed JERSEY-1637 (reopened)."