// Path: kawala-common/src/main/java/com/kaching/platform/common/Range.java
// public static Range range(int start, int end) {
//   return new Range(start, end);
// }
// 
// Path: kawala-testing/src/main/java/com/kaching/platform/testing/EquivalenceTester.java
// public static void check(Collection<?>... equivalenceClasses) {
//   List<List<Object>> ec =
//       newArrayListWithExpectedSize(equivalenceClasses.length);
// 
//   // nothing can be equal to null
//   for (Collection<? extends Object> congruenceClass : equivalenceClasses) {
//     for (Object element : congruenceClass) {
//       try {
//         assertFalse(
//             format("%s can not be equal to null", element),
//             element.equals(null));
//       } catch (NullPointerException e) {
//         throw new AssertionError(
//             format("NullPointerException when comparing %s to null", element));
//       }
//     }
//   }
// 
//   // reflexivity
//   for (Collection<? extends Object> congruenceClass : equivalenceClasses) {
//     List<Object> c = newArrayList();
//     ec.add(c);
//     for (Object element : congruenceClass) {
//       assertTrue(format("reflexivity of %s", element),
//           element.equals(element));
//       compareShouldReturn0(element, element);
//       c.add(element);
//     }
//   }
// 
//   // equality within congruence classes
//   for (List<Object> c : ec) {
//     for (int i = 0; i < c.size(); i++) {
//       Object e1 = c.get(i);
//       for (int j = i + 1; j < c.size(); j++) {
//         Object e2 = c.get(j);
//         assertTrue(format("%s=%s", e1, e2), e1.equals(e2));
//         assertTrue(format("%s=%s", e2, e1), e2.equals(e1));
//         compareShouldReturn0(e1, e2);
//         compareShouldReturn0(e2, e1);
//         assertEquals(format("hashCode %s vs. %s", e1, e2), e1.hashCode(), e2.hashCode());
//       }
//     }
//   }
// 
//   // inequality across congruence classes
//   for (int i = 0; i < ec.size(); i++) {
//     List<Object> c1 = ec.get(i);
//     for (int j = i + 1; j < ec.size(); j++) {
//       List<Object> c2 = ec.get(j);
//       for (Object e1 : c1) {
//         for (Object e2 : c2) {
//           assertFalse(format("%s!=%s", e1, e2), e1.equals(e2));
//           assertFalse(format("%s!=%s", e2, e1), e2.equals(e1));
//           compareShouldNotReturn0(e1, e2);
//           compareShouldNotReturn0(e2, e1);
//         }
//       }
//     }
//   }
// }


import static com.google.common.collect.Lists.newArrayList;
import static com.kaching.platform.common.Range.range;
import static com.kaching.platform.testing.EquivalenceTester.check;
import static junit.framework.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test;
  }

  @Test
  public void testOverlaps() throws Exception {
    assertTrue(new Range(0, 5).overlaps(new Range(2, 4)));
    assertTrue(new Range(0, 5).overlaps(new Range(0, 5)));
    assertTrue(new Range(3, 5).overlaps(new Range(0, 5)));
    assertTrue(new Range(0, 5).overlaps(new Range(0, 6)));
    assertFalse(new Range(0, 5).overlaps(new Range(7, 8)));
    assertFalse(new Range(4, 6).overlaps(new Range(0, 4)));
    assertTrue(new Range(3, 6).overlaps(new Range(0, 4)));
    assertFalse(new Range(4, 6).overlaps(new Range(6, 7)));
    assertTrue(new Range(4, 6).overlaps(new Range(5, 7)));
    assertTrue(new Range(0, 22).overlaps(new Range(13, 16)));
    assertTrue(new Range(13, 16).overlaps(new Range(0, 22)));
  }

  @Test
  public void equivalence() {
    check(
        newArrayList(
            new Range(0, 2),
            new Range(0, 2)),
        newArrayList(
            new Range(1, 3),
            new Range(1, 3)));
  }

  @Test public void itShouldBeFunctional() {
    List<Integer> accumulator = new ArrayList<Integer>();
// Path: kawala-common/src/main/java/com/kaching/platform/common/Range.java
// public static Range range(int start, int end) {
//   return new Range(start, end);
// }
// 
// Path: kawala-testing/src/main/java/com/kaching/platform/testing/EquivalenceTester.java
// public static void check(Collection<?>... equivalenceClasses) {
//   List<List<Object>> ec =
//       newArrayListWithExpectedSize(equivalenceClasses.length);
// 
//   // nothing can be equal to null
//   for (Collection<? extends Object> congruenceClass : equivalenceClasses) {
//     for (Object element : congruenceClass) {
//       try {
//         assertFalse(
//             format("%s can not be equal to null", element),
//             element.equals(null));
//       } catch (NullPointerException e) {
//         throw new AssertionError(
//             format("NullPointerException when comparing %s to null", element));
//       }
//     }
//   }
// 
//   // reflexivity
//   for (Collection<? extends Object> congruenceClass : equivalenceClasses) {
//     List<Object> c = newArrayList();
//     ec.add(c);
//     for (Object element : congruenceClass) {
//       assertTrue(format("reflexivity of %s", element),
//           element.equals(element));
//       compareShouldReturn0(element, element);
//       c.add(element);
//     }
//   }
// 
//   // equality within congruence classes
//   for (List<Object> c : ec) {
//     for (int i = 0; i < c.size(); i++) {
//       Object e1 = c.get(i);
//       for (int j = i + 1; j < c.size(); j++) {
//         Object e2 = c.get(j);
//         assertTrue(format("%s=%s", e1, e2), e1.equals(e2));
//         assertTrue(format("%s=%s", e2, e1), e2.equals(e1));
//         compareShouldReturn0(e1, e2);
//         compareShouldReturn0(e2, e1);
//         assertEquals(format("hashCode %s vs. %s", e1, e2), e1.hashCode(), e2.hashCode());
//       }
//     }
//   }
// 
//   // inequality across congruence classes
//   for (int i = 0; i < ec.size(); i++) {
//     List<Object> c1 = ec.get(i);
//     for (int j = i + 1; j < ec.size(); j++) {
//       List<Object> c2 = ec.get(j);
//       for (Object e1 : c1) {
//         for (Object e2 : c2) {
//           assertFalse(format("%s!=%s", e1, e2), e1.equals(e2));
//           assertFalse(format("%s!=%s", e2, e1), e2.equals(e1));
//           compareShouldNotReturn0(e1, e2);
//           compareShouldNotReturn0(e2, e1);
//         }
//       }
//     }
//   }
// }


// Path: kawala-common-tests/src/test/java/com/kaching/platform/common/RangeTest.java
import static com.google.common.collect.Lists.newArrayList;
import static com.kaching.platform.common.Range.range;
import static com.kaching.platform.testing.EquivalenceTester.check;
import static junit.framework.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test;

  }

  @Test
  public void testOverlaps() throws Exception {
    assertTrue(new Range(0, 5).overlaps(new Range(2, 4)));
    assertTrue(new Range(0, 5).overlaps(new Range(0, 5)));
    assertTrue(new Range(3, 5).overlaps(new Range(0, 5)));
    assertTrue(new Range(0, 5).overlaps(new Range(0, 6)));
    assertFalse(new Range(0, 5).overlaps(new Range(7, 8)));
    assertFalse(new Range(4, 6).overlaps(new Range(0, 4)));
    assertTrue(new Range(3, 6).overlaps(new Range(0, 4)));
    assertFalse(new Range(4, 6).overlaps(new Range(6, 7)));
    assertTrue(new Range(4, 6).overlaps(new Range(5, 7)));
    assertTrue(new Range(0, 22).overlaps(new Range(13, 16)));
    assertTrue(new Range(13, 16).overlaps(new Range(0, 22)));
  }

  @Test
  public void equivalence() {
    check(
        newArrayList(
            new Range(0, 2),
            new Range(0, 2)),
        newArrayList(
            new Range(1, 3),
            new Range(1, 3)));
  }

  @Test public void itShouldBeFunctional() {
    List<Integer> accumulator = new ArrayList<Integer>();
    for (Integer i : range(1, 10)) {