@Override
        public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
            history = new ConcurrentLinkedQueue<>();
            final long size = ExternalizableUtil.getInstance().readLong(in);
            for (int i=0; i<size;i++) {
                Element packetElement = (Element) ExternalizableUtil.getInstance().readSerializable(in);
                history.add(new Message(packetElement, true));
            }
        }
A wrapper for a collection of Message instances that is cached.
xmppserver/src/main/java/org/jivesoftware/openfire/muc/HistoryStrategy.java