@Test
public void testParseEntity () throws Exception {

    final StringEntity entity = new StringEntity("Name1=Value1", null);
    entity.setContentType(URLEncodedUtils.CONTENT_TYPE);
    final List <NameValuePair> result = URLEncodedUtils.parse(entity);
    Assert.assertEquals(1, result.size());
    assertNameValuePair(result.get(0), "Name1", "Value1");
    entity.setContentType("text/test");
    Assert.assertTrue(URLEncodedUtils.parse(entity).isEmpty());
}