code: public boolean isMethodSupported(String methodName,
                                     Class<?>... parameterTypes)
    throws IOException {
      if (serverMethods == null) { // client & server have the same protocol
        return true;
      }
      Method method;
      try {
        method = protocol.getDeclaredMethod(methodName, parameterTypes);
      } catch (SecurityException e) {
        throw new IOException(e);
      } catch (NoSuchMethodException e) {
        throw new IOException(e);
      }
      return serverMethods.contains(
          Integer.valueOf(ProtocolSignature.getFingerprint(method)));
    }
docs: Check if a method is supported by the server or not
  
  @param methodName a method's name in String format
  @param parameterTypes a method's parameter types
  @return true if the method is supported by the server