按顺序处理，如果某一阶段返回true，忽略后续的处理

@param item
@return
515963
@Override
    public boolean onMenuItemClick(MenuItem item) {
        boolean handled = false;

        ShareTarget target = mShareTargets.get(item.getItemId());

        // 首先响应target自带的listener
        if (target.listener != null) {
            handled = target.listener.onMenuItemClick(item);
        }

        if (handled) {
            return true;
        }

        // 其次响应外部设置的listener
        if (mOnMenuItemClickListener != null) {
            handled = mOnMenuItemClickListener.onMenuItemClick(item);
        }
        if (handled) {
            return true;
        }

        if (target.packageName == null || target.className == null) {
            return true;
        }

        // 最后响应默认的intent
        ComponentName chosenName = new ComponentName(
                target.packageName,
                target.className);
        Intent intent = new Intent(mIntent);
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        intent.setComponent(chosenName);
        if (DEBUG) {
            Log.v(TAG, "onMenuItemClick() target=" + chosenName);
        }
        try {
            mContext.startActivity(intent);
        } catch (Exception e) {
            Log.e(TAG, "onMenuItemClick() error: " + e);
            Toast.makeText(mContext, R.string.share_action_provider_target_not_found, Toast.LENGTH_SHORT).show();
        }
        return true;
    }
522388
public int findItemOnlyIdx(JQMListItem item) {
        if (item == null) return -1;
        List<JQMListItem> items = getItems();
        if (items == null) return -1;
        int i = items.indexOf(item);
        if (i == -1) return -1;
        int j = 0;
        for (JQMListItem k : items) {
            if (k == null) continue;
            if (k == item) return j;
            j++;
        }
        return -1;
    }
210088
static boolean isItemInArray(Object item, Object[] arrayOfValues) {
        if (arrayOfValues == null) {
            return false;
        }

        for (Object value : arrayOfValues) {
            if (Objects.equals(value, item)) {
                return true;
            }
        }
        return false;
    }
1366650
private Object itemValue(Object obj, Object item) throws Exception {
		// String value
		if (item instanceof String) {
			return item;
		}

		Element node = (Element) item;
		String tag = node.getTagName();
		// TODO: in case of jdk7 usage use swtich instead
		if ("Call".equals(tag)) {
			return call(obj, node);
		}
		if ("Get".equals(tag)) {
			return get(obj, node);
		}
		if ("New".equals(tag)) {
			return newObj(obj, node);
		}
		if ("Ref".equals(tag)) {
			return refObj(obj, node);
		}
		if ("Array".equals(tag)) {
			return newArray(obj, node);
		}
		if ("Map".equals(tag)) {
			return newMap(obj, node);
		}
		if ("Property".equals(tag)) {
			return propertyObj(obj, node);
		}

		if ("SystemProperty".equals(tag)) {
			String name = getAttribute(node, "name");
			String defaultValue = getAttribute(node, "default");
			return System.getProperty(name, defaultValue);
		}

		LOG.warn("Unknown value tag: {}", node);
		return null;
	}
280309
public static <T> Matcher<Iterable<T>> hasItems(Iterable<T> items) {
        List<Matcher<? super Iterable<T>>> all = new LinkedList<Matcher<? super Iterable<T>>>();
        for (T element : items) {
            all.add(hasItem(element));
        }

        return allOf(all);
    }
448146
protected boolean isDate(String item) {
        if (item == null) {
            return false;
        }

        if (item.matches("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}.\\d{3}Z$")) {
            return true;
        }

        if (item.matches("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$")) {
            return true;
        }

        if (item.matches("^\\d{4}-\\d{2}-\\d{2}$")) {
            return true;
        }

        return false;
    }
1097097
public static ValueListItem retrieve(String item) throws StripeException {
    return retrieve(item, (Map<String, Object>) null, (RequestOptions) null);
  }
216352
public static Item toItem(Map<String, AttributeValue> item) {
        if (item == null) {
            return null;
        }
        return Item.fromMap(toSimpleMapValue(item));
    }
141844
public static <T> T max(Iterable<T> items) {
        T answer = null;
        for (T value : items) {
            if (value != null) {
                if (answer == null || ScriptBytecodeAdapter.compareGreaterThan(value, answer)) {
                    answer = value;
                }
            }
        }
        return answer;
    }
738769
static <T> boolean iterableContains(Iterable<T> iterable, T item) {
    if (iterable instanceof Collection) {
      Collection<?> collection = (Collection<?>) iterable;
      try {
        return collection.contains(item);
      } catch (NullPointerException e) {
        return false;
      } catch (ClassCastException e) {
        return false;
      }
    }
    for (T i : iterable) {
      if (Objects.equal(i, item)) {
        return true;
      }
    }
    return false;
  }
631075
public synchronized T addItem(V item) {
        if(item == null) {
            return self();
        }

        items.add(item);
        if(selectedIndex == -1) {
            selectedIndex = 0;
        }
        invalidate();
        return self();
    }
830351
function (item) {
        return this.members.indexOf(_.isString(item) ? (item = this.one(item)) : item);
    }
870386
protected final boolean callbackOptionsItemSelected(MenuItem item) {
        if (DEBUG) Log.d(TAG, "[callbackOptionsItemSelected] item: " + item.getTitleCondensed());

        boolean result = false;
        if (mActivity instanceof OnMenuItemSelectedListener) {
            OnMenuItemSelectedListener listener = (OnMenuItemSelectedListener)mActivity;
            result = listener.onMenuItemSelected(Window.FEATURE_OPTIONS_PANEL, item);
        } else if (mActivity instanceof OnOptionsItemSelectedListener) {
            OnOptionsItemSelectedListener listener = (OnOptionsItemSelectedListener)mActivity;
            result = listener.onOptionsItemSelected(item);
        }

        if (DEBUG) Log.d(TAG, "[callbackOptionsItemSelected] returning " + result);
        return result;
    }
1156198
public static Map<String, AttributeValue> toAttributeValues(Item item) {
        if (item == null)
            return null;
        // row with multiple attributes
        Map<String, AttributeValue> result = new LinkedHashMap<String, AttributeValue>();
        for (Map.Entry<String, Object> entry : item.attributes())
            result.put(entry.getKey(), toAttributeValue(entry.getValue()));
        return result;
    }
98496
public int add(T item) {
		if (itemIndex.containsKey(item)) {
			// Items can only be added once
			return itemIndex.get(item);
		}
		int index = items.size();
		itemIndex.put(item, index);
		items.add(item);
		return index;
	}
53919
public static final <T> boolean contains(T[] array, T item)
    {
        for (T b : array)
        {
            if (b.equals(item))
            {
                return true;
            }
        }
        return false;
    }
341685
@Override
    public ItemProcessor getProcessor(Item item) {
        for (Map.Entry<String, ItemProcessor> mapping : patternToProcessorMappings.entrySet()) {
            if (item.getUrl().matches(mapping.getKey())) {
                return mapping.getValue();
            }
        }

        return null;
    }