Code listings suspiciously similar to those found in the Lewis and Loftus text are available here:
http://www.cis.uab.edu/ranelli/cs201/Java5Programs/