@BeforeClass
    public static void beforeClass() throws IOException {
        persistenceDelegate_ = new XMLPersistencyService();

        RoutingTable routingTable = new RoutingTable();

        localpeer_ = new PGridHost("localhost", 3000);
        localpeer_.setHostPath("000");
        localpeer_.setTimestamp(10000);
        localpeer_.setUUID(UUID.fromString("12345678-1231-1234-1234-0123456789ad"));

        routingTable.setLocalhost(localpeer_);

        hostList_ = new HashMap<Integer, List<Host>>(3);
        List<Host> levelList = new ArrayList<Host>();
        int level;

        //******* Level 0 *******//
        level = 0;
        Host host = new PGridHost("localhost", 3000);
        host.setHostPath("1");
        host.setTimestamp(0);
        host.setUUID(UUID.fromString("10d82159-3713-4b78-884e-4104720ae2d8"));
        levelList.add(host);

        host = new PGridHost("localhost", 3000);
        host.setHostPath("11");
        host.setTimestamp(0);
        host.setUUID(UUID.fromString("5a29fac1-bb15-4cdd-a071-f33f2b849875"));
        levelList.add(host);

        hostList_.put(level, levelList);
        routingTable.addReference(level, levelList);

        //******* Level 1 *******//
        levelList = new ArrayList<Host>();
        level = 1;

        host = new PGridHost("localhost", 3001);
        host.setHostPath("011");
        host.setTimestamp(1);
        host.setUUID(UUID.fromString("463dad77-627d-4a5d-930b-aab6a4523490"));
        levelList.add(host);

        host = new PGridHost("localhost", 3001);
        host.setHostPath("0111");
        host.setTimestamp(1);
        host.setUUID(UUID.fromString("491fad77-627d-4a5d-930b-aab6a1234567"));
        levelList.add(host);

        host = new PGridHost("localhost", 3001);
        host.setHostPath("01111");
        host.setTimestamp(1);
        host.setUUID(UUID.fromString("ac49991e-68a0-42ad-9c0e-ab328f193e4e"));
        levelList.add(host);

        hostList_.put(level, levelList);
        routingTable.addReference(level, levelList);

        //******* Level 2 *******//
        levelList = new ArrayList<Host>();
        level = 2;

        host = new PGridHost("localhost", 3002);
        host.setHostPath("0011");
        host.setTimestamp(2);
        host.setUUID(UUID.fromString("5a29fac1-bb15-4cdd-a071-f33f2b847349"));
        levelList.add(host);

        hostList_.put(level, levelList);
        routingTable.addReference(level, levelList);

        // Store
        PersistencyDelegate p = new XMLPersistencyService();
        try {
            p.store(VALID_FILE, routingTable);
        } catch (FileNotFoundException e) {
        }

        //************ Invalid File Construction ************//

        OutputStream out = new FileOutputStream(INVALID_ADDRESS_FILE);
        String invalidAddress = new StringBuilder()
                .append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>")
                .append("\n<RoutingTable>")
                .append("\n\t<localpeer>")
                .append("\n\t\t<address>-1</address>") // Error: Invalid ip address
                .append("\n\t\t<port>3000</port>")
                .append("\n\t\t<path>000</path>")
                .append("\n\t\t<timestamp>10001</timestamp>")
                .append("\n\t\t<uuid>12345678-1231-1234-1234-0123456789ad</uuid>")
                .append("\n\t</localpeer>")
                .append("\n</RoutingTable>").toString();
        out.write(invalidAddress.getBytes());
        out.close();

        out = new FileOutputStream(INVALID_PORT_FILE);
        String invalidPort = new StringBuilder()
                .append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>")
                .append("\n<RoutingTable>")
                .append("\n\t<localpeer>")
                .append("\n\t\t<address>localhost</address>")
                .append("\n\t\t<port>-1</port>") // Error: Negative port
                .append("\n\t\t<path>000</path>")
                .append("\n\t\t<timestamp>10001</timestamp>")
                .append("\n\t\t<uuid>12345678-1231-1234-1234-0123456789ad</uuid>")
                .append("\n\t</localpeer>")
                .append("\n</RoutingTable>").toString();
        out.write(invalidPort.getBytes());
        out.close();

        out = new FileOutputStream(INVALID_UUID_FILE);
        String invalidUUID = new StringBuilder()
                .append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>")
                .append("\n<RoutingTable>")
                .append("\n\t<localpeer>")
                .append("\n\t\t<address>localhost</address>")
                .append("\n\t\t<port>3000</port>")
                .append("\n\t\t<path>000</path>")
                .append("\n\t\t<timestamp>10001</timestamp>")
                .append("\n\t\t<uuid>sdfg457h*(</uuid>") // Error: invalid UUID format
                .append("\n\t</localpeer>")
                .append("\n</RoutingTable>").toString();
        out.write(invalidUUID.getBytes());
        out.close();
    }