This method always return empty instance of List. I debugged few lines of the method, then found that it will be ok if only get the two lines
"connection.createPacketCollectorAndSend(request).nextResultOrThrow();
PacketCollector messageCollector = connection.createPacketCollector(packetFilter);"
to
"PacketCollector messageCollector = connection.createPacketCollector(packetFilter);
connection.createPacketCollectorAndSend(request).nextResultOrThrow();"
Means just get these two lines reversed, offline messages will be returned.