Test sample input via redirected 'System.in'.