Autoindention after inserting closing brace improved.

Minor: refactoring

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

Minor: refactoring