User input test code written in Java