private boolean doesRequestMatch(Record request) {
   if (null == expectedRequest) return true;
   if (null == request) return false;
   if (request instanceof MappedRecord) {
     try {
       MappedRecord mappedRequest = (MappedRecord) request;
       if (mappedRequest.size() != expectedRequest.size()) return false;
       Iterator keys = mappedRequest.keySet().iterator();
       while (keys.hasNext()) {
         Object nextKey = keys.next();
         Object actualValue = mappedRequest.get(nextKey);
         Object expectedValue = expectedRequest.get(nextKey);
         if (!areObjectsEquals(actualValue, expectedValue)) {
           return false;
         }
       }
       return true;
     } catch (Exception exc) {
       throw new NestedApplicationException(exc);
     }
   }
   return false;
 }