public BoundMethod bind(Object receiver) {
      Preconditions.checkState(
          !isStatic(), "Cannot bind static method %s", method.toGenericString());
      Preconditions.checkArgument(
          method.getDeclaringClass().isAssignableFrom(receiver.getClass()),
          "Cannot bind %s to instance of %s",
          method.toGenericString(),
          receiver.getClass());

      return new BoundMethod(this, receiver);
    }
Returns this method as a BoundMethod for the given receiver.

@param receiver an Object to receive the method invocation
@return a {@link BoundMethod} for this method and the receiver
@throws IllegalStateException if the method is static
@throws IllegalArgumentException if the receiver's class is incompatible
amoro-common/src/main/java/org/apache/amoro/utils/DynMethods.java