add utility function and java class conversion for tests