@Test
public void fromBytes() {

    int count = 100000;
    Map<String, Long> s = new HashMap<>();
    s.put(UUID.randomUUID().toString(), 1L);
    s.put(UUID.randomUUID().toString(), 2L);
    byte[] content = new byte[1024];
    Utils.toBytes(s, content, 0);
    for (int i = 0; i < count; i++) {
        @SuppressWarnings("unchecked")
        Map<String, Long> s1 = (Map<String, Long>) Utils.fromBytes(content, 0,
                content.length);
        assertEquals(s.size(), s1.size());
        for (Entry<String, Long> e : s1.entrySet()) {
            assertEquals(s.get(e.getKey()), e.getValue());
        }
    }
}