@Override
	public void handleMessages(Inbox inbox) {
		while (inbox.hasNext()) {
			Message m = inbox.next();

			if (m instanceof PackHello) {
				statistic.countHeardMessagesTree();

				PackHello msg = (PackHello) m;

				System.out
						.println("-------------MSG Hello arrive------------------");
				System.out.println("Conteúdo: " + msg.toString());
				System.out.println("De: " + inbox.getSender().ID);
				System.out.println("Para: " + inbox.getReceiver().ID);
				System.out.println("Saiu em: " + inbox.getSendingTime());
				System.out.println("Chegou em: " + inbox.getArrivingTime());
				System.out.println("-------------MSG END------------------");

				protocol.interceptPackHello(inbox, msg);

			} else if (m instanceof PackReply) {

				statistic.countHeardMessagesTree();

				PackReply msg = (PackReply) m;

				System.out
						.println("-------------MSG Reply arrive------------------");
				System.out.println("Conteúdo: " + msg.toString());
				System.out.println("De: " + inbox.getSender().ID);
				System.out.println("Para: " + inbox.getReceiver().ID);
				System.out.println("Saiu em: " + inbox.getSendingTime());
				System.out.println("Chegou em: " + inbox.getArrivingTime());
				System.out.println("-------------MSG END------------------");

				protocol.interceptPackReply(inbox, msg);

			} else if (m instanceof PackEvent) {

				statistic.countHeardMessagesEv((WeightEdge) inbox
						.getIncomingEdge());

				PackEvent msg = (PackEvent) m;

				System.out
						.println("-------------MSG Event arrive------------------");
				System.out.println("Conteúdo: " + msg.toString());
				System.out.println("De: " + inbox.getSender().ID);
				System.out.println("Para: " + inbox.getReceiver().ID);
				System.out.println("Saiu em: " + inbox.getSendingTime());
				System.out.println("Chegou em: " + inbox.getArrivingTime());
				System.out.println("-------------MSG END------------------");

				protocol.interceptPackEvent(inbox, msg);
			}

		}

	}