java test rewritten in ts