Adding Java versions of Pi and LogQuery