@Test
public void testToMap() throws Exception {

    Dictionary<String, String> dic = new Hashtable<>();
    dic.put("key", "value");
    assertThat(toMap(dic).size(), is(1));
    assertThat(toMap(dic).keySet().contains("key"), is(true));
    assertThat(toMap(dic).get("key"), Is.is("value"));
    assertThat(toMap(null), notNullValue());
    assertThat(toMap(null).size(), is(0));
}