protected void removeNextProtocolMessages(List<ProtocolMessage> protocolMessages,int fromIndex){
  for (int i=protocolMessages.size() - 1; i >= fromIndex; i--) {
    protocolMessages.remove(i);
  }
}

protected void removeNextProtocolMessages ( List < ProtocolMessage > protocolMessages , int fromIndex ) { for ( int i = protocolMessages . size ( ) - 1 ; i >= fromIndex ; i -- ) { protocolMessages . remove ( i ) ; } }
in a case the protocol message received was not equal to the messages in our protocol message list , we have to clear our protocol message list .
