Changed the java function
Merge pull request #1 from miriamposner/master

Changed the java function