public static boolean isHasByMsg(List<MsgBean> list, MsgBean msgBean) { int length = list.size(); for (int i = 0; i < length; i++) { if (list.get(i).getId().equals(msgBean.getId())) { return true; } } return false; }