TRUNK-3983: Added Unit Tests and formatting