boolean (Object key) { if (key == null) { return false; } if (myMap instanceof Map) { return asMap().containsKey(key); } Object[] array = (Object[])myMap; for (int i = 0; i < array.length; i += 2) { if (key.equals(array[i])) { return true; } } return false; }