boolean (Object obj) { if (myMap instanceof Map) { return myMap.equals(obj); } if (!(obj instanceof Map)) { return false; } Map<?, ?> map = (Map<?, ?>)obj; if (size() != map.size()) { return false; } Object[] array = (Object[])myMap; for (int i = 0; i < array.length; i += 2) { if (!Comparing.equal(array[i + 1], map.get(array[i]))) { return false; } } return true; }