TRUNK-2303: added more test cases and fixed formatting