code: public static String getMessage (Throwable ex)
      {
          String msg = DEFAULT_ERROR_MSG;
          for (int i = 0; i < _keys.size(); i++) {
              Class<?> cl = _keys.get(i);
              if (cl.isInstance(ex)) {
                  msg = _values.get(i);
                  break;
              }
          }
          return msg.replace(MESSAGE_MARKER, ex.getMessage());
      }
docs: Looks up the supplied exception in the map and returns the most
  specific error message available for exceptions of that class.
  
  @param ex The exception to resolve into an error message.
  
  @return The error message to which this exception maps (properly
  populated with the message associated with this exception
  instance).