Exercise for Java.