I thought Java had short circuit evaluation, yet this line is still throwing a null pointer exception:
if( (perfectAgent != null) && (perfectAgent.ge
Try formatting your code like this:
if( (perfectAgent != null) && ( perfectAgent.getAddress() .equals( entry.getKey() ) ) ) {
It should give you a better stack trace line entry.