@Test
    public void WhenDeserializingValidRoutingTable_ExpectResults() throws UnknownHostException {
        int levels = 2;
        int levelSize = 2;

        StringBuilder builder = new StringBuilder();
        for (int i = 0; i < levels; i++) {
            builder.append("0");
        }

        String expectedLocalIP = "127.0.0.1";
        int expectedLocalPort = 3000;
        String expectedLocalPath = builder.toString();
        String expectedLocalUUID = "12345678-1231-1234-1234-0123456789ad";
        long expectedLocalTS = 0;

        Host localhost = new PGridHost(expectedLocalIP, expectedLocalPort);
        localhost.setHostPath(expectedLocalPath);
        localhost.setUUID(UUID.fromString(expectedLocalUUID));
        localhost.resetTimestamp();

        RoutingTable expectedRT = new RoutingTable();
        expectedRT.setLocalhost(localhost);

        PeerReference[][] levelReferences = new PeerReference[levels][levelSize];

        int levelIndex = 0;
        for (int i = 0; i < levels; i++) {
            for (int j = 0; j < levelSize; j++) {
                Host host = new PGridHost("127.0.0.1", (j + 1) * 1000);
                levelReferences[i][j] = new PeerReference(
                        host.getAddress().getHostAddress(),
                        host.getPort(),
                        host.getHostPath().toString(),
                        host.getTimestamp(),
                        host.getUUID().toString());

                expectedRT.addReference(levelIndex, host);
            }
            levelIndex++;
        }
        PeerReference localRef = new PeerReference(
                expectedLocalIP, expectedLocalPort, expectedLocalPath, expectedLocalTS, expectedLocalUUID);
        CorbaRoutingTable corbaRT = new CorbaRoutingTable(levelReferences, localRef);

        RoutingTable actualRT = Deserializer.deserializeRoutingTable(corbaRT);


        Assert.assertTrue(expectedRT.levelNumber() == actualRT.levelNumber());

        levelIndex = 0;
        for (Collection<Host> actualLevel : actualRT.getAllHostsByLevels()) {
            Collection<Host> expectedLevel = expectedRT.getLevel(levelIndex);
            Assert.assertTrue(expectedLevel.size() == actualLevel.size());
            for (Host actualHost : actualLevel) {
                Assert.assertTrue(expectedRT.contains(actualHost));
                for (Host expectedHost : expectedLevel) {
                    if (expectedHost.compareTo(actualHost) == 0) {
                        Assert.assertTrue(expectedHost.getAddress().getHostAddress()
                                .compareTo(actualHost.getAddress().getHostAddress()) == 0);
                        Assert.assertTrue(expectedHost.getPort() == actualHost.getPort());
                        Assert.assertTrue(expectedHost.getHostPath().toString()
                                .compareTo(actualHost.getHostPath().toString()) == 0);
                        Assert.assertTrue(expectedHost.getUUID().compareTo(actualHost.getUUID()) == 0);
                        Assert.assertTrue(expectedHost.getTimestamp() == actualHost.getTimestamp());
                    }
                }
            }
            levelIndex++;
        }
    }