title: Junit test method returning statement "void type no allowed"
body: <p>I have a method in a a Junit test class, which tests if an email has been changed successfully, the problem is that it is returning an error message saying "void type not allowed" and I am not sure why.</p>
  
  <p>Here is the method, which tests if an email has changed successfully but returns the mentioned error.</p>
  
  <pre><code>  @Test
  public void testChangeEmail()
  {
      assertEquals("001", teacher.getEmail());
      assertEquals("002", teacher.changeEmail("002"));
      assertEquals("002", teacher.getEmail());
  
  }
  </code></pre>
  
  <p>and here is the whole class, </p>
  
  <pre><code>import static org.junit.Assert.*;
  import org.junit.After;
  import org.junit.Before;
  import org.junit.Test;
  
  
  public class TeacherTest
  {
      private Teacher teacher;
  
      /**
       * Default constructor for test class TeacherTest
       */
      public TeacherTest()
      {
      }
  
      /**
       * Sets up the test fixture.
       *
       * Called before every test case method.
       */
      @Before
      public void setUp()
      {
          teacher = new Teacher("Amy Blunt", "001", "MNHA");
      }
  
      /**
       * Tears down the test fixture.
       *
       * Called after every test case method.
       */
      @After
      public void tearDown()
      {
      }
  
      @Test
      public void testGetName()
      {
          assertEquals("Amy Blunt", teacher.getName());
      }
  
      @Test
      public void testMembership()
      {
          assertEquals("001", teacher.getEmail());
      }
  
  
      @Test
      public void testQualifications()
      {
          assertEquals("MNHA", teacher.getQualifications());
      }
  
      @Test
      public void testChangeEmail()
      {
          assertEquals("001", teacher.getEmail());
          assertEquals("002", teacher.changeEmail("002"));
          assertEquals("002", teacher.getEmail());
  
      }
  
  }
  </code></pre>