Effective Java laboratory exercise