code: public IOException unwrapRemoteException(Class<?>... lookupTypes) {
      if(lookupTypes == null)
        return this;
      for(Class<?> lookupClass : lookupTypes) {
        if(!lookupClass.getName().equals(getClassName()))
          continue;
        try {
          return instantiateException(lookupClass.asSubclass(IOException.class));
        } catch(Exception e) {
          // cannot instantiate lookupClass, just return this
          return this;
        }
      }
      // wrapped up exception is not in lookupTypes, just return this
      return this;
    }
docs: If this remote exception wraps up one of the lookupTypes
  then return this exception.
  <p>
  Unwraps any IOException.
  
  @param lookupTypes the desired exception class.
  @return IOException, which is either the lookupClass exception or this.