@Test
public void testSerializationOfMapWithNullKeyGeneratesException() {

    Map<String, String> map = new HashMap<>();
    map.put(null, "Text");
    MapWithNullKeyHolder mapWithNullKeyHolder = new MapWithNullKeyHolder(map);
    try {
        b2Json.toJson(mapWithNullKeyHolder);
        assertTrue("Map with null key should not be allowed to be serialized", false);
    } catch (B2JsonException ex) {
        assertEquals("Map key is null", ex.getMessage());
    }
}