public static boolean isMatch(Method lhs, Method rhs){
    if(!lhs.getName().equals(rhs.getName())
        || !Modifier.isPublic(lhs.getDeclaringClass().getModifiers())){
      return false;
    }

    Class<?>[] types1 = lhs.getParameterTypes();
    Class<?>[] types2 = rhs.getParameterTypes();
    if(types1.length != types2.length)
      return false;

    boolean match = true;
    for (int i=0; i<types1.length; ++i){
      if(!types1[i].isAssignableFrom(types2[i])){
        match = false;
        break;
      }
    }
    return match;
  }