Fix array out of bounds exception coming from JavaParser.java
Change test file to support different parsers