code: protected static Invocable resolveExpectedJavaMethod(
              BshClassManager bcm, Class<?> clas, Object object,
              String name, Object[] args, boolean staticOnly )
              throws ReflectError, UtilEvalError {
          if ( object == Primitive.NULL )
              throw new UtilTargetError( new NullPointerException(
                  "Attempt to invoke method " +name+" on null value" ) );
  
          Class<?>[] types = Types.getTypes(args);
          Invocable method = resolveJavaMethod( clas, name, types, staticOnly );
          if ( null != bcm && bcm.getStrictJava()
                  && method != null && method.getDeclaringClass().isInterface()
                  && method.getDeclaringClass() != clas
                  && Modifier.isStatic(method.getModifiers()))
              // static interface methods are class only
              method = null;
  
          if ( method == null )
              throw new ReflectError(
                  ( staticOnly ? "Static method " : "Method " )
                  + StringUtil.methodString(name, types) +
                  " not found in class'" + clas.getName() + "'");
  
          return method;
      }
docs: This method wraps resolveJavaMethod() and expects a non-null method
  result. If the method is not found it throws a descriptive ReflectError.