Java coding challenge.