code: public boolean acceptsSubstitution(Method m) {
          Class<?>[] paramTypes = m.getParameterTypes();
          if (paramTypes.length > 0) {
              // Check if last param is a Substitution
              Class<?> lastParam = paramTypes[paramTypes.length - 1];
              return Substitution.class.isAssignableFrom(lastParam);
          }
          return false;
      }
docs: Returns true if the specified method accepts a
  <code>Substitution</code> as its last parameter.