@Test
    public void WhenUpdatingAndLocalhostDecreasedHisPath_ExpectLevelsAdded() throws UnknownHostException {
        int refMax = Integer.MAX_VALUE;

        RoutingTable localRT = new RoutingTable();
        localhost_.setHostPath("000000");
        localRT.setLocalhost(localhost_);
        Host localHost0 = new PGridHost("127.0.0.1", 1110);
        localHost0.setHostPath("10");
        Host localHost1 = new PGridHost("127.0.0.1", 1111);
        localHost1.setHostPath("010");
        Host localHost2 = new PGridHost("127.0.0.1", 1112);
        localHost2.setHostPath("0010");
        localRT.addReference(0, localHost0);
        localRT.addReference(1, localHost1);
        localRT.addReference(2, localHost2);

        RoutingTable remoteRT = new RoutingTable();
        Host remoteHost = new PGridHost("127.0.0.1", 1234);
        remoteHost.setHostPath("0001");
        remoteRT.setLocalhost(remoteHost);
        Host remoteHost0 = new PGridHost("127.0.0.1", 2220);
        remoteHost0.setHostPath("11"); // conjugate of localHost0
        Host remoteHost1 = new PGridHost("127.0.0.1", 2221);
        remoteHost1.setHostPath("011"); // conjugate of localHost1
        Host remoteHost2 = new PGridHost("127.0.0.1", 2222);
        remoteHost2.setHostPath("0011"); // conjugate of localHost2
        remoteRT.addReference(0, remoteHost0);
        remoteRT.addReference(1, remoteHost1);
        remoteRT.addReference(2, remoteHost2);

        int commonLength = localhost_.getHostPath().commonPrefix(remoteHost.getHostPath()).length();

        localhost_.setHostPath("000");
        localRT.update(remoteRT, commonLength, refMax);

        int expectedLevels = 3;
        int expected0levelSize = 2; // "1"
        int expected1levelSize = 2; // "01"
        int expected2levelSize = 2; // "001"

        Assert.assertTrue(localRT.levelNumber() == expectedLevels);
        Assert.assertTrue(localRT.getLevel(0).size() == expected0levelSize);
        Assert.assertTrue(localRT.getLevel(1).size() == expected1levelSize);
        Assert.assertTrue(localRT.getLevel(2).size() == expected2levelSize);

        Assert.assertTrue(localRT.getLevel(0).contains(localHost0) && localRT.getLevel(0).contains(remoteHost0));
        Assert.assertTrue(localRT.getLevel(1).contains(localHost1) && localRT.getLevel(1).contains(remoteHost1));
        Assert.assertTrue(localRT.getLevel(2).contains(localHost2) && localRT.getLevel(2).contains(remoteHost2));
        Assert.assertFalse(localRT.contains(remoteHost));
    }