public HStore createStoreMock(String name) throws Exception {
    HStore store = mock(HStore.class, name);
    when(store.requestCompaction(anyInt(), any(), any())).then(inv -> selectCompaction());
    when(store.getCompactPriority()).then(inv -> getPriority());
    doAnswer(new CancelAnswer()).when(store).cancelRequestedCompaction(any());
    return store;
  }
This class is a helper that allows to create a partially-implemented, stateful mocks of Store. It
contains a bunch of blank methods, and answers redirecting to these.
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/StatefulStoreMockMaker.java