public static void compareFiles(String filePath1, String filePath2, List<String> messageDeliverOrder) {
        System.out.println("Comparing " + filePath1 + " and " + filePath2 + " by thread " + Thread.currentThread().getName());
        try {
            BufferedReader bufferedReader = new BufferedReader(new FileReader(filePath1));

            String message;

            while ((message = bufferedReader.readLine()) != null) {
                messageDeliverOrder.add(message);
            }

            bufferedReader.close();
            bufferedReader = new BufferedReader(new FileReader(filePath2));
            int msgExpectedIdx = 0;

            while ((message = bufferedReader.readLine()) != null) {
                if (msgExpectedIdx >= messageDeliverOrder.size()) {
                    messageDeliverOrder.add(message);
                    ++msgExpectedIdx;
                    continue;
                }
                String otherMessage = messageDeliverOrder.get(msgExpectedIdx);
                if (otherMessage.equals(message)) {
                    msgExpectedIdx++;
                    continue;
                }

                int realMsgIdx = messageDeliverOrder.indexOf(message);

                if (realMsgIdx == -1) {
                    continue;
                } else if (realMsgIdx < msgExpectedIdx) {
                    System.err.println("[" + Thread.currentThread().getName() + "] Message deliver out of order: " + message);
                }
                msgExpectedIdx = realMsgIdx + 1;
            }

            bufferedReader.close();
        } catch (FileNotFoundException e) {
            e.printStackTrace();  // TODO: Customise this generated block
        } catch (IOException e) {
            e.printStackTrace();  // TODO: Customise this generated block
        } finally {
            System.out.println("Finished comparing this files");
        }
    }