@SuppressWarnings({"unchecked"})
    public static <K, V> Map<K, V> generateMapField(Class<K> keyType, Class<V> valueType) {
        Random random = new Random(987654321L);
        Map<K, V> map = new HashMap<K, V>();
        for (int i = 0; i < 20; i++) {
            K key = null;
            if (keyType == String.class) {
                key = (K) String.valueOf(random.nextInt());
            } else if (keyType == Integer.class) {
                key = (K) Integer.valueOf(random.nextInt());
            } else if (keyType == Long.class) {
                key = (K) Long.valueOf(random.nextLong());
            }

            V value = null;
            if (valueType == String.class) {
                value = (V) String.valueOf(random.nextInt());
            } else if (valueType == Integer.class) {
                value = (V) Integer.valueOf(random.nextInt());
            } else if (valueType == Long.class) {
                value = (V) Long.valueOf(random.nextLong());
            } else if (valueType == Double.class) {
                value = (V) Double.valueOf(random.nextDouble());
            } else if (valueType == byte[].class) {
                byte[] bytes = Bytes.toBytes(random.nextInt());
                value = (V) bytes;
            }
            map.put(key, value);
        }
        return map;
    }