private boolean isMatch(RobotRequest req, RobotResponseHeader resp){ if(req == null || resp == null){ theLogger.info("Received null request or response header, unable to determine match."); throw new NullPointerException(); } if(!req.getRobotId().equals(resp.getRobotId())){ theLogger.log(Level.INFO, "Requested Robot Id ({0}) does not match Response Robot Id ({1}).", new Object[]{req.getRobotId(), resp.getRobotId()}); return false; }else if(!req.getRequestType().equals(resp.getRequestType())){ theLogger.log(Level.INFO, "Request Type ({0}) does not match Response Type ({1}).", new Object[]{req.getRequestType(), resp.getRequestType()}); return false; /*}else if(!req.getSourceId().equals(resp.getDestinationId())){ return false; }else if(!req.getDestinationId().equals(resp.getSourceId())){ return false; */}else if(req.getTimestampMillisecUTC() != resp.getRequestTimestampMillisecUTC()){ theLogger.log(Level.INFO, "Request Timestamp ({0}) does not match Response Request Timestamp ({1}).", new Object[]{req.getTimestampMillisecUTC(), resp.getRequestTimestampMillisecUTC()}); return false; } return true; } }