I tried searching for some automated tool but couldn't find any. So basically i just want this C++ code to be translated into Java code.