title: Should Java interface only contain getters?
body: <p>I have some general questions regarding interface usage:</p>
  
  <ol>
  <li>What is the advantages in creating interface for each object class ?</li>
  <li>Should interface only contains 'getter' methods? </li>
  <li>Why not also the setter? </li>
  <li>Why should I create for each object class an interface? Will it served me in the JUnit tests?</li>
  </ol>
  
  <p>For example :</p>
  
  <pre><code>    public interface Animal {
        public getVoice();
        public String getName();
      }
  
  public class Dog implements Animal {
     private String name;
  
     public getVoice(){
        System.out.println("Brrr");
     }
     public String getName(){
        return this.name;
     }
     public void setName(String name){
        this.name = name;
    }
  
  }
  </code></pre>
  
  <p>Thanks</p>