obsolete "junit.framework" replaced with "org.junit" in tests
added string bound check if input string ends with an invalid escape sequence