title: EasyMock 3.0, mocking class throws java.lang.IllegalStateException: no last call on a mock available
body: <p>Running the following unit test throws the exception: java.lang.IllegalStateException: no last call on a mock available</p>
  
  <pre><code>
  import org.easymock.*;
  import org.junit.*;
  
  public class MyTest {
  
      @Test
      public void testWithClass() {
          Thread threadMock = EasyMock.createMock(Thread.class);
          EasyMock.expect(threadMock.isAlive()).andReturn(true);
      }
  }
  </code></pre>
  
  <p>I am not sure what I am doing wrong and can not find any good examples on the web.  How do you mock a class using EasyMock 3.0.  What is wrong with the above unit test?  Any help would be greatly appreciated.</p>
  
  <p>My project includes the following maven dependencies</p>
  
  <pre><code>&lt;dependency&gt;
     &lt;groupId&gt;org.easymock&lt;/groupId&gt;
     &lt;artifactId&gt;easymock&lt;/artifactId&gt;
     &lt;version&gt;3.0&lt;/version&gt;
     &lt;scope&gt;test&lt;/scope&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
     &lt;groupId&gt;cglib&lt;/groupId&gt;
     &lt;artifactId&gt;cglib-nodep&lt;/artifactId&gt;
     &lt;version&gt;2.2&lt;/version&gt;
     &lt;scope&gt;test&lt;/scope&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
     &lt;groupId&gt;org.objenesis&lt;/groupId&gt;
     &lt;artifactId&gt;objenesis&lt;/artifactId&gt;
     &lt;version&gt;1.2&lt;/version&gt;
     &lt;scope&gt;test&lt;/scope&gt;
  &lt;/dependency&gt;
  </code></pre>