@Override
        public int getCachedSize() throws CannotCalculateSizeException
        {
            // Approximate the size of the object in bytes by calculating the size of each field.
            int size = 0;
            size += CacheSizes.sizeOfObject();   // overhead of object
            size += CacheSizes.sizeOfString(id); // id
            return size;
        }
The random number to use, someone with Java can predict stream IDs if they can guess the current seed
xmppserver/src/main/java/org/jivesoftware/openfire/spi/BasicStreamIDFactory.java