title: JUNIT Null Pointer Exception
body: <p>it's my first time using JUNIT and I literally cannot get it to work.</p>
  
  <p>I've got a person class, in which has firstName and lastName, and a test class in which I need to test the methods.  Everytime I attempt to test one though, if i've wrote a test for the particular method, it fails.</p>
  
  <p>Here is my code.</p>
  
  <p><strong>Person Class</strong></p>
  
  <pre><code>public class Person {
      private String firstName;
      private String lastName;    
  
      public Person (String a, String b) {
          firstName = a;
          lastName = b;
      }
  
      public String getfirstName() {
          return firstName;
      }
  
      public void setfirstName(String firstName) {
          this.firstName = firstName;
      }
  
      public String getlastName() {
          return lastName;
      }
  
      public void setlastName(String lastName) {
          this.lastName = lastName;
      }
  
      @Override
      public String toString() {
          return  firstName + " " + lastName;
      }
  }
  </code></pre>
  
  <p><strong>Person Test class</strong></p>
  
  <pre><code>public class PersonTest {
      Person p1;
  
      public PersonTest() {
          Person p1 = new Person ("Thomas", "Brown");
      }
  
      @Before
      public void setUp() {}
  
      @After
      public void tearDown() {}
  
      @Test
      public void testGetfirstName() {
          assertEquals("Thomas", p1.getfirstName());
      }
  
      @Test
      public void testSetfirstName() {}
  
      @Test
      public void testGetlastName() {
          assertEquals("Brown", p1.getlastName());
      }
  
      @Test
      public void testSetlastName() {}
  
      @Test
      public void testToString() {
          assertEquals("Thomas Brown", p1.toString());
      }
  }
  </code></pre>
  
  <p>Could anyone point me in the right direction?</p>