You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by jb...@apache.org on 2010/02/24 00:07:03 UTC

svn commit: r915575 [3/3] - in /incubator/cassandra/trunk: ./ contrib/word_count/src/ interface/thrift/gen-java/org/apache/cassandra/thrift/ src/java/org/apache/cassandra/auth/ src/java/org/apache/cassandra/avro/ src/java/org/apache/cassandra/cache/ sr...

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/thrift/ThriftGlue.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/thrift/ThriftGlue.java?rev=915575&r1=915574&r2=915575&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/thrift/ThriftGlue.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/thrift/ThriftGlue.java Tue Feb 23 23:07:01 2010
@@ -1,4 +1,25 @@
 package org.apache.cassandra.thrift;
+/*
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ */
+
 
 import java.util.List;
 

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/tools/NodeCmd.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/tools/NodeCmd.java?rev=915575&r1=915574&r2=915575&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/tools/NodeCmd.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/tools/NodeCmd.java Tue Feb 23 23:07:01 2010
@@ -1,4 +1,25 @@
 package org.apache.cassandra.tools;
+/*
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ */
+
 
 import java.io.IOException;
 import java.io.PrintStream;

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/utils/LatencyTracker.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/utils/LatencyTracker.java?rev=915575&r1=915574&r2=915575&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/utils/LatencyTracker.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/utils/LatencyTracker.java Tue Feb 23 23:07:01 2010
@@ -1,4 +1,25 @@
 package org.apache.cassandra.utils;
+/*
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ */
+
 
 import java.util.concurrent.atomic.AtomicLong;
 

Modified: incubator/cassandra/trunk/test/unit/org/apache/cassandra/dht/BoundsTest.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/test/unit/org/apache/cassandra/dht/BoundsTest.java?rev=915575&r1=915574&r2=915575&view=diff
==============================================================================
--- incubator/cassandra/trunk/test/unit/org/apache/cassandra/dht/BoundsTest.java (original)
+++ incubator/cassandra/trunk/test/unit/org/apache/cassandra/dht/BoundsTest.java Tue Feb 23 23:07:01 2010
@@ -1,73 +1,94 @@
-package org.apache.cassandra.dht;
-
-import java.util.*;
-
-import junit.framework.TestCase;
-import org.apache.cassandra.utils.FBUtilities;
-
-public class BoundsTest extends TestCase
-{
-    public void testRestrictTo() throws Exception
-    {
-        IPartitioner p = new OrderPreservingPartitioner();
-        Token min = p.getMinimumToken();
-        Range wraps = new Range(new StringToken("m"), new StringToken("e"));
-        Range normal = new Range(wraps.right, wraps.left);
-        Bounds all = new Bounds(min, min, p);
-        Bounds almostAll = new Bounds(new StringToken("a"), min, p);
-
-        Set<AbstractBounds> S;
-        Set<AbstractBounds> S2;
-
-        S = all.restrictTo(wraps);
-        assert S.equals(new HashSet<AbstractBounds>(Arrays.asList(wraps)));
-
-        S = almostAll.restrictTo(wraps);
-        S2 = new HashSet<AbstractBounds>(Arrays.asList(new Bounds(new StringToken("a"), new StringToken("e"), p),
-                                                       new Range(new StringToken("m"), min)));
-        assert S.equals(S2);
-
-        S = all.restrictTo(normal);
-        assert S.equals(new HashSet<AbstractBounds>(Arrays.asList(normal)));
-    }
-
-    public void testNoIntersectionWrapped()
-    {
-        IPartitioner p = new OrderPreservingPartitioner();
-        Range node = new Range(new StringToken("z"), new StringToken("a"));
-        Bounds bounds;
-
-        bounds = new Bounds(new StringToken("m"), new StringToken("n"), p);
-        assert bounds.restrictTo(node).equals(Collections.<AbstractBounds>emptySet());
-
-        bounds = new Bounds(new StringToken("b"), node.left, p);
-        assert bounds.restrictTo(node).equals(Collections.<AbstractBounds>emptySet());
-    }
-
-    public void testSmallBoundsFullRange()
-    {
-        IPartitioner p = new OrderPreservingPartitioner();
-        Range node;
-        Bounds bounds = new Bounds(new StringToken("b"), new StringToken("c"), p);
-
-        node = new Range(new StringToken("d"), new StringToken("d"));
-        assert bounds.restrictTo(node).equals(new HashSet(Arrays.asList(bounds)));
-    }
-
-    public void testNoIntersectionUnwrapped()
-    {
-        IPartitioner p = new OrderPreservingPartitioner();
-        Token min = p.getMinimumToken();
-        Range node = new Range(new StringToken("m"), new StringToken("n"));
-        Bounds bounds;
-
-        bounds = new Bounds(new StringToken("z"), min, p);
-        assert bounds.restrictTo(node).equals(Collections.<AbstractBounds>emptySet());
-
-        bounds = new Bounds(new StringToken("a"), node.left, p);
-        assert bounds.restrictTo(node).equals(Collections.<AbstractBounds>emptySet());
-
-        bounds = new Bounds(min, new StringToken("b"), p);
-        assert bounds.restrictTo(node).equals(Collections.<AbstractBounds>emptySet());
-    }
-}
+package org.apache.cassandra.dht;
+/*
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ */
+
+
+import java.util.*;
+
+import junit.framework.TestCase;
+import org.apache.cassandra.utils.FBUtilities;
+
+public class BoundsTest extends TestCase
+{
+    public void testRestrictTo() throws Exception
+    {
+        IPartitioner p = new OrderPreservingPartitioner();
+        Token min = p.getMinimumToken();
+        Range wraps = new Range(new StringToken("m"), new StringToken("e"));
+        Range normal = new Range(wraps.right, wraps.left);
+        Bounds all = new Bounds(min, min, p);
+        Bounds almostAll = new Bounds(new StringToken("a"), min, p);
+
+        Set<AbstractBounds> S;
+        Set<AbstractBounds> S2;
+
+        S = all.restrictTo(wraps);
+        assert S.equals(new HashSet<AbstractBounds>(Arrays.asList(wraps)));
+
+        S = almostAll.restrictTo(wraps);
+        S2 = new HashSet<AbstractBounds>(Arrays.asList(new Bounds(new StringToken("a"), new StringToken("e"), p),
+                                                       new Range(new StringToken("m"), min)));
+        assert S.equals(S2);
+
+        S = all.restrictTo(normal);
+        assert S.equals(new HashSet<AbstractBounds>(Arrays.asList(normal)));
+    }
+
+    public void testNoIntersectionWrapped()
+    {
+        IPartitioner p = new OrderPreservingPartitioner();
+        Range node = new Range(new StringToken("z"), new StringToken("a"));
+        Bounds bounds;
+
+        bounds = new Bounds(new StringToken("m"), new StringToken("n"), p);
+        assert bounds.restrictTo(node).equals(Collections.<AbstractBounds>emptySet());
+
+        bounds = new Bounds(new StringToken("b"), node.left, p);
+        assert bounds.restrictTo(node).equals(Collections.<AbstractBounds>emptySet());
+    }
+
+    public void testSmallBoundsFullRange()
+    {
+        IPartitioner p = new OrderPreservingPartitioner();
+        Range node;
+        Bounds bounds = new Bounds(new StringToken("b"), new StringToken("c"), p);
+
+        node = new Range(new StringToken("d"), new StringToken("d"));
+        assert bounds.restrictTo(node).equals(new HashSet(Arrays.asList(bounds)));
+    }
+
+    public void testNoIntersectionUnwrapped()
+    {
+        IPartitioner p = new OrderPreservingPartitioner();
+        Token min = p.getMinimumToken();
+        Range node = new Range(new StringToken("m"), new StringToken("n"));
+        Bounds bounds;
+
+        bounds = new Bounds(new StringToken("z"), min, p);
+        assert bounds.restrictTo(node).equals(Collections.<AbstractBounds>emptySet());
+
+        bounds = new Bounds(new StringToken("a"), node.left, p);
+        assert bounds.restrictTo(node).equals(Collections.<AbstractBounds>emptySet());
+
+        bounds = new Bounds(min, new StringToken("b"), p);
+        assert bounds.restrictTo(node).equals(Collections.<AbstractBounds>emptySet());
+    }
+}

Modified: incubator/cassandra/trunk/test/unit/org/apache/cassandra/dht/RangeIntersectionTest.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/test/unit/org/apache/cassandra/dht/RangeIntersectionTest.java?rev=915575&r1=915574&r2=915575&view=diff
==============================================================================
--- incubator/cassandra/trunk/test/unit/org/apache/cassandra/dht/RangeIntersectionTest.java (original)
+++ incubator/cassandra/trunk/test/unit/org/apache/cassandra/dht/RangeIntersectionTest.java Tue Feb 23 23:07:01 2010
@@ -1,131 +1,152 @@
-package org.apache.cassandra.dht;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.Set;
-
-import org.apache.commons.lang.StringUtils;
-import org.junit.Test;
-
-public class RangeIntersectionTest
-{
-    static void assertIntersection(Range one, Range two, Range ... ranges)
-    {
-        Set<Range> correct = Range.rangeSet(ranges);
-        Set<Range> result1 = one.intersectionWith(two);
-        assert result1.equals(correct) : String.format("%s != %s",
-                                                       StringUtils.join(result1, ","),
-                                                       StringUtils.join(correct, ","));
-        Set<Range> result2 = two.intersectionWith(one);
-        assert result2.equals(correct) : String.format("%s != %s",
-                                                       StringUtils.join(result2, ","),
-                                                       StringUtils.join(correct, ","));
-    }
-
-    private void assertNoIntersection(Range wraps1, Range nowrap3)
-    {
-        assertIntersection(wraps1, nowrap3);
-    }
-
-    @Test
-    public void testIntersectionWithAll()
-    {
-        Range all0 = new Range(new BigIntegerToken("0"), new BigIntegerToken("0"));
-        Range all10 = new Range(new BigIntegerToken("10"), new BigIntegerToken("10"));
-        Range all100 = new Range(new BigIntegerToken("100"), new BigIntegerToken("100"));
-        Range all1000 = new Range(new BigIntegerToken("1000"), new BigIntegerToken("1000"));
-        Range wraps = new Range(new BigIntegerToken("100"), new BigIntegerToken("10"));
-
-        assertIntersection(all0, wraps, wraps);
-        assertIntersection(all10, wraps, wraps);
-        assertIntersection(all100, wraps, wraps);
-        assertIntersection(all1000, wraps, wraps);
-    }
-
-    @Test
-    public void testIntersectionContains()
-    {
-        Range wraps1 = new Range(new BigIntegerToken("100"), new BigIntegerToken("10"));
-        Range wraps2 = new Range(new BigIntegerToken("90"), new BigIntegerToken("20"));
-        Range wraps3 = new Range(new BigIntegerToken("90"), new BigIntegerToken("0"));
-        Range nowrap1 = new Range(new BigIntegerToken("100"), new BigIntegerToken("110"));
-        Range nowrap2 = new Range(new BigIntegerToken("0"), new BigIntegerToken("10"));
-        Range nowrap3 = new Range(new BigIntegerToken("0"), new BigIntegerToken("9"));
-
-        assertIntersection(wraps1, wraps2, wraps1);
-        assertIntersection(wraps3, wraps2, wraps3);
-
-        assertIntersection(wraps1, nowrap1, nowrap1);
-        assertIntersection(wraps1, nowrap2, nowrap2);
-        assertIntersection(nowrap2, nowrap3, nowrap3);
-
-        assertIntersection(wraps1, wraps1, wraps1);
-        assertIntersection(nowrap1, nowrap1, nowrap1);
-        assertIntersection(nowrap2, nowrap2, nowrap2);
-        assertIntersection(wraps3, wraps3, wraps3);
-    }
-
-    @Test
-    public void testNoIntersection()
-    {
-        Range wraps1 = new Range(new BigIntegerToken("100"), new BigIntegerToken("10"));
-        Range wraps2 = new Range(new BigIntegerToken("100"), new BigIntegerToken("0"));
-        Range nowrap1 = new Range(new BigIntegerToken("0"), new BigIntegerToken("100"));
-        Range nowrap2 = new Range(new BigIntegerToken("100"), new BigIntegerToken("200"));
-        Range nowrap3 = new Range(new BigIntegerToken("10"), new BigIntegerToken("100"));
-
-        assertNoIntersection(wraps1, nowrap3);
-        assertNoIntersection(wraps2, nowrap1);
-        assertNoIntersection(nowrap1, nowrap2);
-    }
-
-    @Test
-    public void testIntersectionOneWraps()
-    {
-        Range wraps1 = new Range(new BigIntegerToken("100"), new BigIntegerToken("10"));
-        Range wraps2 = new Range(new BigIntegerToken("100"), new BigIntegerToken("0"));
-        Range nowrap1 = new Range(new BigIntegerToken("0"), new BigIntegerToken("200"));
-        Range nowrap2 = new Range(new BigIntegerToken("0"), new BigIntegerToken("100"));
-
-        assertIntersection(wraps1,
-                           nowrap1,
-                           new Range(new BigIntegerToken("0"), new BigIntegerToken("10")),
-                           new Range(new BigIntegerToken("100"), new BigIntegerToken("200")));
-        assertIntersection(wraps2,
-                           nowrap1,
-                           new Range(new BigIntegerToken("100"), new BigIntegerToken("200")));
-        assertIntersection(wraps1,
-                           nowrap2,
-                           new Range(new BigIntegerToken("0"), new BigIntegerToken("10")));
-    }
-
-    @Test
-    public void testIntersectionTwoWraps()
-    {
-        Range wraps1 = new Range(new BigIntegerToken("100"), new BigIntegerToken("20"));
-        Range wraps2 = new Range(new BigIntegerToken("120"), new BigIntegerToken("90"));
-        Range wraps3 = new Range(new BigIntegerToken("120"), new BigIntegerToken("110"));
-        Range wraps4 = new Range(new BigIntegerToken("10"), new BigIntegerToken("0"));
-        Range wraps5 = new Range(new BigIntegerToken("10"), new BigIntegerToken("1"));
-        Range wraps6 = new Range(new BigIntegerToken("30"), new BigIntegerToken("10"));
-
-        assertIntersection(wraps1,
-                           wraps2,
-                           new Range(new BigIntegerToken("120"), new BigIntegerToken("20")));
-        assertIntersection(wraps1,
-                           wraps3,
-                           new Range(new BigIntegerToken("120"), new BigIntegerToken("20")),
-                           new Range(new BigIntegerToken("100"), new BigIntegerToken("110")));
-        assertIntersection(wraps1,
-                           wraps4,
-                           new Range(new BigIntegerToken("10"), new BigIntegerToken("20")),
-                           new Range(new BigIntegerToken("100"), new BigIntegerToken("0")));
-        assertIntersection(wraps1,
-                           wraps5,
-                           new Range(new BigIntegerToken("10"), new BigIntegerToken("20")),
-                           new Range(new BigIntegerToken("100"), new BigIntegerToken("1")));
-        assertIntersection(wraps1,
-                           wraps6,
-                           new Range(new BigIntegerToken("100"), new BigIntegerToken("10")));
-    }
-}
+package org.apache.cassandra.dht;
+/*
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ */
+
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.commons.lang.StringUtils;
+import org.junit.Test;
+
+public class RangeIntersectionTest
+{
+    static void assertIntersection(Range one, Range two, Range ... ranges)
+    {
+        Set<Range> correct = Range.rangeSet(ranges);
+        Set<Range> result1 = one.intersectionWith(two);
+        assert result1.equals(correct) : String.format("%s != %s",
+                                                       StringUtils.join(result1, ","),
+                                                       StringUtils.join(correct, ","));
+        Set<Range> result2 = two.intersectionWith(one);
+        assert result2.equals(correct) : String.format("%s != %s",
+                                                       StringUtils.join(result2, ","),
+                                                       StringUtils.join(correct, ","));
+    }
+
+    private void assertNoIntersection(Range wraps1, Range nowrap3)
+    {
+        assertIntersection(wraps1, nowrap3);
+    }
+
+    @Test
+    public void testIntersectionWithAll()
+    {
+        Range all0 = new Range(new BigIntegerToken("0"), new BigIntegerToken("0"));
+        Range all10 = new Range(new BigIntegerToken("10"), new BigIntegerToken("10"));
+        Range all100 = new Range(new BigIntegerToken("100"), new BigIntegerToken("100"));
+        Range all1000 = new Range(new BigIntegerToken("1000"), new BigIntegerToken("1000"));
+        Range wraps = new Range(new BigIntegerToken("100"), new BigIntegerToken("10"));
+
+        assertIntersection(all0, wraps, wraps);
+        assertIntersection(all10, wraps, wraps);
+        assertIntersection(all100, wraps, wraps);
+        assertIntersection(all1000, wraps, wraps);
+    }
+
+    @Test
+    public void testIntersectionContains()
+    {
+        Range wraps1 = new Range(new BigIntegerToken("100"), new BigIntegerToken("10"));
+        Range wraps2 = new Range(new BigIntegerToken("90"), new BigIntegerToken("20"));
+        Range wraps3 = new Range(new BigIntegerToken("90"), new BigIntegerToken("0"));
+        Range nowrap1 = new Range(new BigIntegerToken("100"), new BigIntegerToken("110"));
+        Range nowrap2 = new Range(new BigIntegerToken("0"), new BigIntegerToken("10"));
+        Range nowrap3 = new Range(new BigIntegerToken("0"), new BigIntegerToken("9"));
+
+        assertIntersection(wraps1, wraps2, wraps1);
+        assertIntersection(wraps3, wraps2, wraps3);
+
+        assertIntersection(wraps1, nowrap1, nowrap1);
+        assertIntersection(wraps1, nowrap2, nowrap2);
+        assertIntersection(nowrap2, nowrap3, nowrap3);
+
+        assertIntersection(wraps1, wraps1, wraps1);
+        assertIntersection(nowrap1, nowrap1, nowrap1);
+        assertIntersection(nowrap2, nowrap2, nowrap2);
+        assertIntersection(wraps3, wraps3, wraps3);
+    }
+
+    @Test
+    public void testNoIntersection()
+    {
+        Range wraps1 = new Range(new BigIntegerToken("100"), new BigIntegerToken("10"));
+        Range wraps2 = new Range(new BigIntegerToken("100"), new BigIntegerToken("0"));
+        Range nowrap1 = new Range(new BigIntegerToken("0"), new BigIntegerToken("100"));
+        Range nowrap2 = new Range(new BigIntegerToken("100"), new BigIntegerToken("200"));
+        Range nowrap3 = new Range(new BigIntegerToken("10"), new BigIntegerToken("100"));
+
+        assertNoIntersection(wraps1, nowrap3);
+        assertNoIntersection(wraps2, nowrap1);
+        assertNoIntersection(nowrap1, nowrap2);
+    }
+
+    @Test
+    public void testIntersectionOneWraps()
+    {
+        Range wraps1 = new Range(new BigIntegerToken("100"), new BigIntegerToken("10"));
+        Range wraps2 = new Range(new BigIntegerToken("100"), new BigIntegerToken("0"));
+        Range nowrap1 = new Range(new BigIntegerToken("0"), new BigIntegerToken("200"));
+        Range nowrap2 = new Range(new BigIntegerToken("0"), new BigIntegerToken("100"));
+
+        assertIntersection(wraps1,
+                           nowrap1,
+                           new Range(new BigIntegerToken("0"), new BigIntegerToken("10")),
+                           new Range(new BigIntegerToken("100"), new BigIntegerToken("200")));
+        assertIntersection(wraps2,
+                           nowrap1,
+                           new Range(new BigIntegerToken("100"), new BigIntegerToken("200")));
+        assertIntersection(wraps1,
+                           nowrap2,
+                           new Range(new BigIntegerToken("0"), new BigIntegerToken("10")));
+    }
+
+    @Test
+    public void testIntersectionTwoWraps()
+    {
+        Range wraps1 = new Range(new BigIntegerToken("100"), new BigIntegerToken("20"));
+        Range wraps2 = new Range(new BigIntegerToken("120"), new BigIntegerToken("90"));
+        Range wraps3 = new Range(new BigIntegerToken("120"), new BigIntegerToken("110"));
+        Range wraps4 = new Range(new BigIntegerToken("10"), new BigIntegerToken("0"));
+        Range wraps5 = new Range(new BigIntegerToken("10"), new BigIntegerToken("1"));
+        Range wraps6 = new Range(new BigIntegerToken("30"), new BigIntegerToken("10"));
+
+        assertIntersection(wraps1,
+                           wraps2,
+                           new Range(new BigIntegerToken("120"), new BigIntegerToken("20")));
+        assertIntersection(wraps1,
+                           wraps3,
+                           new Range(new BigIntegerToken("120"), new BigIntegerToken("20")),
+                           new Range(new BigIntegerToken("100"), new BigIntegerToken("110")));
+        assertIntersection(wraps1,
+                           wraps4,
+                           new Range(new BigIntegerToken("10"), new BigIntegerToken("20")),
+                           new Range(new BigIntegerToken("100"), new BigIntegerToken("0")));
+        assertIntersection(wraps1,
+                           wraps5,
+                           new Range(new BigIntegerToken("10"), new BigIntegerToken("20")),
+                           new Range(new BigIntegerToken("100"), new BigIntegerToken("1")));
+        assertIntersection(wraps1,
+                           wraps6,
+                           new Range(new BigIntegerToken("100"), new BigIntegerToken("10")));
+    }
+}