Test program while learning Java