@@ -0,0 +1,2892 @@
+/*%0A * Copyright (c) 2013 - 2014 xxyy (Philipp Nowak; devnull@nowak-at.net). All rights reserved.%0A *%0A * Any usage, including, but not limited to, compiling, running, redistributing, printing,%0A *  copying and reverse-engineering is strictly prohibited without explicit written permission%0A *  from the original author and may result in legal steps being taken.%0A */%0A%0Apackage io.github.xxyy.common.util;%0A%0Aimport org.bukkit.Location;%0Aimport org.bukkit.World;%0Aimport org.junit.Test;%0A%0Aimport static junit.framework.TestCase.assertFalse;%0Aimport static org.junit.Assert.assertTrue;%0Aimport static org.mockito.Mockito.mock;%0A%0Apublic class LocationHelperTest %7B%0A    private final World WORLD_1 = mock(World.class);%0A    private final World WORLD_2 = mock(World.class);%0A%0A    @Test%0A    public void testIsBlockBetween() throws Exception %7B%0A        Location boundary1 = new Location(WORLD_1, 0, 0, 0);%0A        Location boundary2 = new Location(WORLD_1, 50, 50, 50);%0A%0A        Location obviousInBetween = new Location(WORLD_1, 1, 1, 1);%0A        Location borderInBetween = new Location(WORLD_1, 0, 1, 1);%0A%0A        Location notInBetween = new Location(WORLD_1, -12, -5, 48);%0A        Location differentWorld = new Location(WORLD_2, 1, 1, 1);%0A%0A        assertTrue(%22Obviously in-between location not recognized!%22, LocationHelper.isBlockBetween(obviousInBetween, boundary1, boundary2));%0A        assertTrue(%22Border location not recognized!%22, LocationHelper.isBlockBetween(borderInBetween, boundary1, boundary2));%0A%0A        assertFalse(%22Obviously not-in-between location falsely recognized!%22, LocationHelper.isBlockBetween(notInBetween, boundary1, boundary2));%0A        assertFalse(%22Location in different world falsely recognized!%22, LocationHelper.isBlockBetween(differentWorld, boundary1, boundary2));%0A    %7D%0A%0A    @Test%0A    public void testSoftEqual() throws Exception %7B%0A        Location location1 = new Location(WORLD_1, 0, 42, 56);%0A        Location location1Clone = location1.clone();%0A        Location location1Same = new Location(WORLD_1, 0, 42, 56);%0A        Location location1DifferentWorld = new Location(WORLD_2, 0, 42, 56);%0A        Location location2 = new Location(WORLD_1, 15, 78, 56);%0A        Location location3 = new Location(WORLD_1, 15, 42, 56);%0A%0A        assertTrue(%22Cloned location not soft-equal!%22, LocationHelper.softEqual(location1, location1Clone));%0A        assertTrue(%22Same location not soft-equal!%22, LocationHelper.softEqual(location1, location1Same));%0A%0A        assertFalse(%22Different location soft-equal! (1)%22, LocationHelper.softEqual(location1, location2));%0A        assertFalse(%22Different location soft-equal! (2)%22, LocationHelper.softEqual(location1, location3));%0A        assertFalse(%22Different location soft-equal! (3)%22, LocationHelper.softEqual(location3, location2));%0A        assertFalse(%22Different world location soft-equal!%22, LocationHelper.softEqual(location1DifferentWorld, location1));%0A    %7D%0A%7D%0A

Add unit test for LocationHelper