title: How to enable “replace by method reference” refactoring (and Java 8 features) in Android Studio
body: <p>IntelliJ can refactor this:</p>
  
  <pre><code>class Foo {
      static void bar() {}
      static {
          new Runnable() {
              @Override
              public void run() {
                  Foo.bar();
              }
          }.run();
      }
  }
  </code></pre>
  
  <p>into that:</p>
  
  <pre><code>class Foo {
      static void bar() {}
      static {
          ((Runnable) Foo::bar).run();
      }
  }
  </code></pre>
  
  <p>Isn't it nicer? (thanks <a href="http://blog.jetbrains.com/idea/2012/10/java-8-and-method-references-in-intellij-idea-12/" rel="nofollow">Anna Kozlova</a>). Now that Android supports Java 8, how can I do that in Android Studio?</p>