title: Java - Intercepting methods using guice?
body: <p>I am trying to implement method interception using guice.
  I want to be able to annotate methods and intercept them and I am getting an error when trying to call bindInterceptor.</p>
  
  <p>The error is:
  <strong>The method bindInterceptor(Matcher, Matcher, MyInterceptor) is undefined for the type MyModule</strong></p>
  
  <p>Am i doing anything wrong?</p>
  
  <pre><code>public class MyInterceptor implements MethodInterceptor {
  
      @Override
      public Object invoke(MethodInvocation arg0) throws Throwable {
          return arg0.proceed();
      }
  }
  
  public class MyModule extends AbstractModule {
  
      @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD)
      @interface MyAnnotation {}
  
      @Override
      protected void configure() {
              // I get an error on this line
          bindInterceptor(Matchers.any(), Matchers.annotatedWith(MyAnnotation.class), 
                  new MyInterceptor());
      }
  }
  </code></pre>