@@ -0,0 +1,2420 @@
+package wordcram;%0A%0A/*%0A Copyright 2010 Daniel Bernier%0A%0A Licensed under the Apache License, Version 2.0 (the %22License%22);%0A you may not use this file except in compliance with the License.%0A You may obtain a copy of the License at%0A%0A http://www.apache.org/licenses/LICENSE-2.0%0A%0A Unless required by applicable law or agreed to in writing, software%0A distributed under the License is distributed on an %22AS IS%22 BASIS,%0A WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A See the License for the specific language governing permissions and%0A limitations under the License.%0A */%0A%0Aimport junit.framework.Assert;%0A%0Aimport org.junit.Test;%0A%0Apublic class ABBTree %7B%0A%0A    @Test%0A    public void testContainsPoint() %7B%0A%09// TODO Could this be done better w/ a theory?%0A%09// (Or whatever those JUnit things are called.)%0A%09BBTree testTree = makeTree(20, 20, 100, 100);%0A%0A%09Assert.assertTrue(testTree.containsPoint(22, 22));%0A%09Assert.assertFalse(testTree.containsPoint(22, 18));%0A%09Assert.assertFalse(testTree.containsPoint(18, 22));%0A%0A%09Assert.assertTrue(testTree.containsPoint(98, 98));%0A%09Assert.assertFalse(testTree.containsPoint(98, 102));%0A%09Assert.assertFalse(testTree.containsPoint(102, 98));%0A%0A%09Assert.assertTrue(testTree.containsPoint(22, 98));%0A%09Assert.assertFalse(testTree.containsPoint(22, 102));%0A%09Assert.assertFalse(testTree.containsPoint(18, 98));%0A%0A%09Assert.assertTrue(testTree.containsPoint(98, 22));%0A%09Assert.assertFalse(testTree.containsPoint(98, 18));%0A%09Assert.assertFalse(testTree.containsPoint(102, 22));%0A   %0A%09for (int i = 21; i %3C 100; i++) %7B%0A%09    for (int j = 21; j %3C 100; j++) %7B%0A%09%09Assert.assertTrue(testTree.containsPoint(i, j));%0A%09    %7D%0A%09%7D%0A    %7D%0A%0A    @Test%0A    public void testOverlaps() %7B%0A%09BBTree a = makeTree(0, 0, 30, 30);%0A%09BBTree b = makeTree(0, 0, 5, 5);%0A%0A%09Assert.assertTrue(a.overlaps(b));%0A%09Assert.assertTrue(b.overlaps(a));%0A%0A%09b.setLocation(40, 40);%0A%09Assert.assertFalse(a.overlaps(b));%0A%09Assert.assertFalse(b.overlaps(a));%0A%0A%09b.setLocation(29, 29);%0A%09Assert.assertTrue(a.overlaps(b));%0A%09Assert.assertTrue(b.overlaps(a));%0A%0A%09a.setLocation(32, 0);%0A%09Assert.assertTrue(a.overlaps(b));%0A%09Assert.assertTrue(b.overlaps(a));%0A%0A%09a.setLocation(32, 33);%0A%09Assert.assertTrue(a.overlaps(b));%0A%09Assert.assertTrue(b.overlaps(a));%0A%0A%09a.setLocation(32, 34);%0A%09Assert.assertFalse(a.overlaps(b));%0A%09Assert.assertFalse(b.overlaps(a));%0A    %7D%0A%0A    BBTree makeTree(int x, int y, int right, int bottom) %7B%0A%09return new BBTree(x, y, right, bottom);%0A    %7D%0A%7D

Add tests for BBTree