A small Java exercise for CO320 students