title: Creating a UrlEncodedFormEntity from a List of NameValuePairs throws a NullPointerException
body: <p>I'm creating a unit test to try out the servlet I just created. </p>
  
  <pre><code>@Test
  public void test() throws ParseException, IOException {
  
    HttpClient client = new DefaultHttpClient();
    HttpPost post = new HttpPost("http://localhost:8080/WebService/MakeBaby");
  
    List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;();
  
    nameValuePairs.add(new BasicNameValuePair("father_name", "Foo"));
    nameValuePairs.add(new BasicNameValuePair("mother_name", "Bar"));
  
    post.setEntity(new UrlEncodedFormEntity(nameValuePairs));
    HttpResponse response = null;
  
    try {
      response = client.execute(post);
    } catch (ClientProtocolException e) {
      e.printStackTrace();
    } catch (IOException e) {
      e.printStackTrace();
    }
  
    String stringifiedResponse = EntityUtils.toString(response.getEntity());
  
    System.out.println(stringifiedResponse);
  
    assertNotNull(stringifiedResponse);
  }
  </code></pre>
  
  <p>The following line generates a NullPointerException:</p>
  
  <pre><code>post.setEntity(new UrlEncodedFormEntity(nameValuePairs));
  </code></pre>
  
  <p>Is there something I'm missing?</p>