Fixed bugs in JavaLangUtils and added unit tests