class VisitorDataQueue extends VisitorDataHandler {

    @Override
    public void onMessage(Message m, AckToken token) {
        if (m instanceof PutDocumentMessage) {
            appendSingleOpToPendingList(((PutDocumentMessage)m).getDocumentPut(), token);
        } else if (m instanceof RemoveDocumentMessage) {
            appendSingleOpToPendingList(((RemoveDocumentMessage)m).getDocumentRemove(), token);
        } else {
            throw new UnsupportedOperationException(
                    String.format("Expected put/remove message, got '%s' of type %s",
                                  m.toString(), m.getClass().toString()));
        }
    }

    public  VisitorDataQueue();

}