Updated groovy test coverage.

Added method comments.
Optimised code