Object key = NSKeyValueCodingAdditions.Utility.valueForKeyPath(object,keyPath);
boolean isNullKey = key==null || key instanceof NSKeyValueCoding.Null;
if (!isNullKey || nullGroupingKey != null) {
if (isNullKey) key=nullGroupingKey;
NSArray array = (NSArray)key;
for(@SuppressWarnings("null") Enumeration keys = array.objectEnumerator(); keys.hasMoreElements(); ) {
key = keys.nextElement();
NSMutableArray existingGroup=(NSMutableArray)result.objectForKey(key);
if (existingGroup==null) {
existingGroup=new NSMutableArray();
result.setObjectForKey(existingGroup,key);