title: Same method for multiple classes that implement the same interface
body: <p>Sorry I really didn't know how to title the question, here's the problem...</p>
  
  <p>I have an interface and multiple classes that implement the interface. The implementation of some of the methods in the interface are exactly the same in every implementing class. I feel like there should be a way to simplify this so I don't have to write the same code every time. Example:</p>
  
  <pre><code>public interface Foo {
      String getName();
  }
  
  public class FooImpl1 implements Foo {
      private String name = "foo name1";
  
      public String getName() {
          return name;
      }
  }
  
  public class FooImpl2 implements Foo {
      private String name = "foo name2";
  
      public String getName() {
          return name;
      }
  }
  </code></pre>
  
  <p>So to break down..</p>
  
  <ol>
  <li><p>is there a way to put the code for getName in one place and each class has it's own name variable?</p></li>
  <li><p>is there a way to make getName static so I don't have to create a new instance</p></li>
  </ol>
  
  <p>Have better ideas?</p>