title: Write unit tests for an interface or each implementation?
body: <p>I have a Java interface and a couple of implementations for it. Now I want to write unit test cases using Mockito.</p>
  
  <p>My question is, should I write mock test cases each implementation or mock test cases only for interface? What is the best practice in this scenario? I hope my question makes sense. Please correct me, if I am missing something.</p>
  
  <p>Classes Details:</p>
  
  <pre><code>interface MessageQueue {
      add()
      poll()
      size()
  }
  
  class InMemoryMessageQueue implements MessageQueue {
      add() {
          //implementation
      }
      poll() {
          //implementation
      }
      size() {
          //implementation
      }
  }
  
  class FileSystemMessageQueue implements MessageQueue {
      add() {
          //implementation
      }
      poll() {
          //implementation
      }
      size() {
          //implementation
      }
  }
  </code></pre>
  
  <p>Currently I have Unit test cases only for <code>MessageQueue</code> interface using Mockito.  </p>