@Test public void testSomePairsPresent() { String tagQuery = "k1=v1,k2=v2,k3=v3"; List<Label> expectedPairs = LabelUtils.generatePairs(tagQuery); List<Label> actualPairs = new ArrayList<>(); actualPairs.add(new Label("k1", "v1")); actualPairs.add(new Label("k2", "v2")); assertTrue(LabelUtils.somePairsPresent(expectedPairs, actualPairs)); }
public static boolean somePairsPresent(List<Label> expectedTags, List<Label> actualTags) { for (Label expectedTag : expectedTags) { if (actualTags.contains(expectedTag)) { return true; } } return false; }
LabelUtils { public static boolean somePairsPresent(List<Label> expectedTags, List<Label> actualTags) { for (Label expectedTag : expectedTags) { if (actualTags.contains(expectedTag)) { return true; } } return false; } }
LabelUtils { public static boolean somePairsPresent(List<Label> expectedTags, List<Label> actualTags) { for (Label expectedTag : expectedTags) { if (actualTags.contains(expectedTag)) { return true; } } return false; }  }
LabelUtils { public static boolean somePairsPresent(List<Label> expectedTags, List<Label> actualTags) { for (Label expectedTag : expectedTags) { if (actualTags.contains(expectedTag)) { return true; } } return false; }  static List<Label> generatePairs(String tagQuery); static boolean allPairsPresent(List<Label> expectedTags, List<Label> actualTags); static boolean somePairsPresent(List<Label> expectedTags, List<Label> actualTags); }
LabelUtils { public static boolean somePairsPresent(List<Label> expectedTags, List<Label> actualTags) { for (Label expectedTag : expectedTags) { if (actualTags.contains(expectedTag)) { return true; } } return false; }  static List<Label> generatePairs(String tagQuery); static boolean allPairsPresent(List<Label> expectedTags, List<Label> actualTags); static boolean somePairsPresent(List<Label> expectedTags, List<Label> actualTags); static final String OR_OPERAND; static final String AND_OPERAND; static final String LABEL_QUERY_PARAM; static final String LABEL_OP_QUERY_PARAM; }