@Test public void testGetDerivedPairs() throws Exception { final String[] multiConsensusGroupIds = { "2213.0", "2214.0"}; final String[] outsideJson = { OUTSIDE_2213, OUTSIDE_2214 }; final Set<CanvasMatches> multiConsensusPairs = new TreeSet<>(); for (int i = 0; i < multiConsensusGroupIds.length; i++) { multiConsensusPairs.addAll(CanvasMatches.fromJsonArray(outsideJson[i])); } final ConsensusSetPairs consensusSetPairs = new ConsensusSetPairs(multiConsensusPairs); final List<CanvasMatches> derivedPairs = consensusSetPairs.getDerivedPairs(); Assert.assertEquals("invalid number of derived pairs", 4, derivedPairs.size()); final Set<String> canvasIdSet = new LinkedHashSet<>(); for (final CanvasMatches pair : derivedPairs) { canvasIdSet.add(pair.getpId()); canvasIdSet.add(pair.getqId()); } Assert.assertEquals("invalid number of canvases", 4, canvasIdSet.size()); final String[] expectedCanvasIds = { "z_2213.0_box_40532_42182_3731_3654_0.274457", "z_2214.0_box_40532_42182_3731_3654_0.274457_set_2213.0_2214.0_0", "z_2214.0_box_40532_42182_3731_3654_0.274457_set_2213.0_2214.0_1", "z_2215.0_box_40532_42182_3731_3654_0.274457"}; for (final String expectedId : expectedCanvasIds) { Assert.assertTrue("missing canvas id " + expectedId + " in " + canvasIdSet, canvasIdSet.contains(expectedId)); } }
public List<CanvasMatches> getDerivedPairs() { return derivedPairs; }
ConsensusSetPairs { public List<CanvasMatches> getDerivedPairs() { return derivedPairs; } }
ConsensusSetPairs { public List<CanvasMatches> getDerivedPairs() { return derivedPairs; } @SuppressWarnings("Convert2streamapi")  ConsensusSetPairs(final Set<CanvasMatches> multiConsensusPairs); }
ConsensusSetPairs { public List<CanvasMatches> getDerivedPairs() { return derivedPairs; } @SuppressWarnings("Convert2streamapi")  ConsensusSetPairs(final Set<CanvasMatches> multiConsensusPairs); List<CanvasMatches> getDerivedPairs(); boolean hasSplitGroups(); Set<String> getSplitGroupIds(); @Override String toString(); }
ConsensusSetPairs { public List<CanvasMatches> getDerivedPairs() { return derivedPairs; } @SuppressWarnings("Convert2streamapi")  ConsensusSetPairs(final Set<CanvasMatches> multiConsensusPairs); List<CanvasMatches> getDerivedPairs(); boolean hasSplitGroups(); Set<String> getSplitGroupIds(); @Override String toString();  }