RefreshableMessageStore primaryStore = (RefreshableMessageStore) store;
MessageStore primaryStore = store;
    public void testRefreshableMessageStore() throws Exception {        if (store instanceof RefreshableMessageStore) {            RefreshableMessageStore failoverStore = (RefreshableMessageStore) getMessageStoreFactory()                    .create(sessionID);            try {                RefreshableMessageStore primaryStore = (RefreshableMessageStore) store;                assertEquals("wrong value", 1, primaryStore.getNextSenderMsgSeqNum());                assertEquals("wrong value", 1, primaryStore.getNextTargetMsgSeqNum());                assertEquals("wrong value", 1, failoverStore.getNextSenderMsgSeqNum());                assertEquals("wrong value", 1, failoverStore.getNextTargetMsgSeqNum());                primaryStore.setNextSenderMsgSeqNum(20);                primaryStore.setNextTargetMsgSeqNum(20);                assertEquals("wrong value", 20, primaryStore.getNextSenderMsgSeqNum());                assertEquals("wrong value", 20, primaryStore.getNextTargetMsgSeqNum());                closeMessageStore(primaryStore);                assertEquals("wrong value", 1, failoverStore.getNextSenderMsgSeqNum());                assertEquals("wrong value", 1, failoverStore.getNextTargetMsgSeqNum());                failoverStore.refresh();                assertEquals("wrong value", 20, failoverStore.getNextSenderMsgSeqNum());                assertEquals("wrong value", 20, failoverStore.getNextTargetMsgSeqNum());            } finally {                closeMessageStore(failoverStore);            }        }    }