Convert tests to java