Added java class to test text and did minor fixes