public static boolean loadTreeNetworkTest(){
        //!!! TEST WILL FAIL IF EQUALS COMPARES TREE IDs!!!
        int portTemp=TaskClientNetDriver.SERVER_PORT;
        InetAddress tempAddress=TaskClientNetDriver.SERVER_ADDRESS;
        TaskClientNetDriver.SERVER_PORT=TEST_PORT;
        try {TaskClientNetDriver.SERVER_ADDRESS=InetAddress.getLocalHost();} catch (UnknownHostException e) {}

        try {
            final NetworkInteraction interaction = new NetworkInteraction();
            IDGenerator idGenerator= new IDGenerator();
            Data data = new Data("test string");
            final TaskTree tree = new TaskTree(idGenerator, data);
            interaction.setTree(tree);

            //Faking transfer:
            Thread fakeThread = new Thread(){
                public void run()
                {
                    ServerSocket server=null;
                    Socket fakeServer=null;
                    ObjectInputStream fakeServerInput=null;
                    ObjectOutputStream fakeServerOutput=null;
                    try {
                        server = new ServerSocket(TEST_PORT);
                        fakeServer=server.accept();
                        fakeServerInput=new ObjectInputStream(fakeServer.getInputStream());
                        fakeServerOutput=new ObjectOutputStream(fakeServer.getOutputStream());
                        NetworkInteraction fakeInteraction=(NetworkInteraction) fakeServerInput.readObject();

                        //faking transmission from server:
                        fakeInteraction.setTree(tree);
                        fakeInteraction.setReplyCode(NetworkInteraction.ReplyCode.SUCCESS);
                        fakeServerOutput.writeObject(fakeInteraction);
                        fakeServerOutput.flush();
                    } catch (Exception e) {
                        e.printStackTrace();
                    } finally {
                        try {
                            if (server!=null) server.close();
                            if (fakeServer!=null) fakeServer.close();
                            if (fakeServerInput!=null) fakeServerInput.close();
                            if (fakeServerOutput!=null) fakeServerOutput.close();
                        } catch (IOException e) {
                            e.printStackTrace();
                        }
                    }
                }
            };
            fakeThread.start();
            TaskTree loadedTree=TaskClientNetDriver.loadTree();
            if (!loadedTree.equals(tree)) {
                throw new Exception("Tree that arrived from fake server differs");
            }
            fakeThread.join();
            return true;
        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }
        finally {
            TaskClientNetDriver.SERVER_PORT=portTemp;
            TaskClientNetDriver.SERVER_ADDRESS=tempAddress;
        }
    }