title: How to use Mockito to mock including an EntityManager
body: <p>Currently in school we are working on a rather large project. However testing in Java wasn't really explained that well so I didn't really work TDD like I was suppose to.</p>
  
  <pre><code>protected EntityManager getEntityManager() {
      return EntityController.getEntityManager();
  }
  
  // Get all exam skeletons from the DB
  @Override
  public List&lt;ExamSkeleton&gt; getAllSkeletons() {
      EntityManager entityManager = getEntityManager();
      try {
          TypedQuery&lt;ExamSkeleton&gt; query = entityManager.createQuery("SELECT NEW ExamSkeleton (s.id, s.filename, s.course, s.visible) FROM ExamSkeleton as s", ExamSkeleton.class);
  
          List&lt;ExamSkeleton&gt; skeletons = query.getResultList();
  
          return skeletons;
      } catch (IllegalArgumentException exception) {
          LOGGER.error(exception);
      }
          return Collections.emptyList();
  }
  </code></pre>
  
  <p>So my question is, how do I test this method using Mockito?</p>