Remove the local onos/core/Pair.java class and replace it with
the corresponding "org.apache.commons.lang3.tuple.Pair" from Apache.
Usage differences:
* "new Pair<>(a, b)" -> "Pair.of(a, b)"
Note that "Pair.of()" returns immutable pair by definition: ImmutablePair
* "Pair.getFirst()" -> "Pair.getLeft()"
"Pair.getSecond()" -> "Pair.getRight()"
Also, few replacements for HashMap and similar containers:
"new HashMap<Foo, Bar>()" -> "new HashMap<>()"
Change-Id: I7a3d8a34dac37c672f0d1779f83f50dfeba8dec7
diff --git a/src/test/java/net/onrc/onos/core/newintent/SingleSrcTreeFlowIntentTest.java b/src/test/java/net/onrc/onos/core/newintent/SingleSrcTreeFlowIntentTest.java
index cfd9391..a9a3dbf 100644
--- a/src/test/java/net/onrc/onos/core/newintent/SingleSrcTreeFlowIntentTest.java
+++ b/src/test/java/net/onrc/onos/core/newintent/SingleSrcTreeFlowIntentTest.java
@@ -10,10 +10,11 @@
import net.onrc.onos.core.matchaction.match.PacketMatch;
import net.onrc.onos.core.matchaction.match.PacketMatchBuilder;
import net.onrc.onos.core.util.Dpid;
-import net.onrc.onos.core.util.Pair;
import net.onrc.onos.core.util.PortNumber;
import net.onrc.onos.core.util.SwitchPort;
+import org.apache.commons.lang3.tuple.Pair;
+
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
@@ -41,8 +42,8 @@
@Override
protected SingleSrcTreeFlowIntent createOne() {
Set<Pair<Dpid, OutputAction>> actions = new HashSet<>(Arrays.asList(
- new Pair<>(dpid2, action2),
- new Pair<>(dpid3, action3)
+ Pair.of(dpid2, action2),
+ Pair.of(dpid3, action3)
));
SingleSrcTreeFlow tree = new SingleSrcTreeFlow(flowId1, match,
new SwitchPort(dpid1, port3), createTree(), actions
@@ -53,8 +54,8 @@
@Override
protected SingleSrcTreeFlowIntent createAnother() {
Set<Pair<Dpid, OutputAction>> actions = new HashSet<>(Arrays.asList(
- new Pair<>(dpid1, action1),
- new Pair<>(dpid3, action3)
+ Pair.of(dpid1, action1),
+ Pair.of(dpid3, action3)
));
SingleSrcTreeFlow tree = new SingleSrcTreeFlow(flowId2, match,
new SwitchPort(dpid2, port3), createTree(), actions