Closing brase bug fixed. Added several tests.

 #KT-5544 Fixed
Constant strings for tokens.

Minor: refactoring, java code conventions