various Java exercises