Java stream - purpose of having both anyMatch and noneMatch operations?
问题 The anyMatch operation will return true if it finds an element - the noneMatch operation will return false it if finds a matching element. The anyMatch operation will return false if it finds no matching element - the noneMatch operation will return true if finds no matching element. Therefore, instead of having both of these operations, could we not just do with one, or am I missing something? In essence, anyMatch returning false is a way of evaluating the truth of noneMatch's predicate. 回答1