package tachyon;

import org.junit.Assert;
import org.junit.Test;

/**
 * Unit tests for tachyon.Pair
 */
public class PairTest {
  private String strType = "test";
  private Integer integerType = 7883;
  private Long longType = 9887L;
  private Double doubleType = 3.14159;
  private Boolean boolType = false;
  private Character charType = 'a';
  private Object[] obj = new Object[6];

  @Test
  public void constructorTest() {
    obj[0] = strType;
    obj[1] = integerType;
    obj[2] = longType;
    obj[3] = doubleType;
    obj[4] = boolType;
    obj[5] = charType;

    for (int k = 0; k < 5; k ++) {
      Pair tPair = new Pair(obj[k], obj[k + 1]);
      Assert.assertEquals(obj[k], tPair.getFirst());
      Assert.assertEquals(obj[k + 1], tPair.getSecond());
      Assert.assertNotSame(obj[k + 1], tPair.getFirst());
      Assert.assertNotSame(obj[k], tPair.getSecond());
    }
  }
}
@@ -583,20 +583,83 @@
 int 
-k = 0; k %3C 5
+j = 0; j %3C obj.length - 1; j ++) %7B%0A      for (int k = j + 1; k %3C obj.length
 ; k 
@@ -660,24 +660,26 @@
 th; k ++) %7B%0A
+  
       Pair t
@@ -702,17 +702,17 @@
 obj%5B
-k
+j
 %5D, obj%5Bk
  + 1
@@ -711,16 +711,14 @@
 bj%5Bk
- + 1
 %5D);%0A
+  
     
@@ -739,25 +739,25 @@
 tEquals(obj%5B
-k
+j
 %5D, tPair.get
@@ -758,32 +758,34 @@
 ir.getFirst());%0A
+  
       Assert.ass
@@ -795,28 +795,24 @@
 Equals(obj%5Bk
- + 1
 %5D, tPair.get
@@ -820,32 +820,34 @@
 econd());%0A      
+  
 Assert.assertNot
@@ -856,20 +856,16 @@
 me(obj%5Bk
- + 1
 %5D, tPair
@@ -880,24 +880,26 @@
 t());%0A      
+  
 Assert.asser
@@ -903,33 +903,33 @@
 sertNotSame(obj%5B
-k
+j
 %5D, tPair.getSeco
@@ -931,23 +931,31 @@
 tSecond());%0A
+      %7D%0A
     %7D%0A  %7D%0A%7D

test all combination of defined pairs