public String retrieveBucketStats(ClientParameters.SelectionType type, String id, BucketId bucketId, String bucketSpace) throws BucketStatsException {
        String documentSelection = createDocumentSelection(type, id);
        StatBucketMessage msg = new StatBucketMessage(bucketId, bucketSpace, documentSelection);
        StatBucketReply statBucketReply = sendMessage(msg, StatBucketReply.class);
        return statBucketReply.getResults();
    }
@Test
    void testRetrieveBucketStats() throws BucketStatsException {
        String docId = "id:ns:type::another";
        String bucketInfo = "I like turtles!";
        BucketId bucketId = bucketIdFactory.getBucketId(new DocumentId(docId));

        StatBucketReply reply = new StatBucketReply();
        reply.setResults(bucketInfo);
        when(mockedSession.syncSend(any())).thenReturn(reply);
        String result = createRetriever().retrieveBucketStats(ClientParameters.SelectionType.DOCUMENT, docId, bucketId, bucketSpace);

        verify(mockedSession, times(1)).syncSend(any());
        assertEquals(bucketInfo, result);
    }