Some methods are now static.

Minor: java code conventions, refactoring
Autoindention after inserting closing brace improved.

 #KT-5657 Fixed
Closing brace tests added and several tests changed.

Minor: refactoring