@Test
public void testParseEntity() throws Exception {

    final StringEntity entity1 = new StringEntity("Name1=Value1", ContentType.APPLICATION_FORM_URLENCODED);
    final List<NameValuePair> result = EntityUtils.parse(entity1);
    Assert.assertEquals(1, result.size());
    assertNameValuePair(result.get(0), "Name1", "Value1");
    final StringEntity entity2 = new StringEntity("Name1=Value1", ContentType.parse("text/test"));
    Assert.assertTrue(EntityUtils.parse(entity2).isEmpty());
}