public static <K, V> Map<K, V> toMap(final Object... items) {
        if (items == null || items.length == 0) {
            return Collections.emptyMap();
        } else {
            if (items.length % 2 != 0) {
                throw new RuntimeException("Odd number of items");
            }
            final Map<K, V> map = new HashMap<>(items.length / 2);
            for (int i = 0; i < items.length; i++) {
                final K key = (K) items[i++];
                final V val = (V) items[i];
                map.put(key, val);
            }
            return map;
        }
    }
Util class for doing various things not emulated in GWT
stroom-util-shared/src/main/java/stroom/util/shared/GwtUtil.java