Moving JS tests to Java