Improve reliability by converting the test to Java Reviewed-by: dsamersoff, dholmes
Reviewed-by: darcy, weijun