### Question:
TabletRegistry { public Tablet startTablet(HRegionInfo regionInfo, HTableDescriptor tableDescriptor, List<Long> peerList) throws IOException { Path basePath = configDirectory.getBaseConfigPath(); String quorumName = regionInfo.getRegionNameAsString(); configDirectory.writeBinaryData(quorumName, ConfigDirectory.regionInfoFile, regionInfo.toByteArray()); configDirectory.writeBinaryData(quorumName, ConfigDirectory.htableDescriptorFile, tableDescriptor.toByteArray()); configDirectory.writePeersToFile(quorumName, peerList); Tablet tablet = tabletFactory.create( c5server, regionInfo, tableDescriptor, peerList, basePath, legacyConf, replicationModule, regionCreator, new UserTabletLeaderBehavior(c5server, regionInfo)); tablet.setStateChangeChannel(commonStateChangeChannel); tablet.start(); ConcurrentSkipListMap<byte[], Tablet> tablets; String tableName = TabletNameHelpers.toString(TabletNameHelpers.getClientTableName(regionInfo.getTable())); byte[] rowKey; if (regionInfo.getEndKey().length == 0) { rowKey = new byte[0]; } else { rowKey = regionInfo.getEndKey(); } if (tables.containsKey(tableName)) { tablets = tables.get(tableName); } else { tablets = new ConcurrentSkipListMap<>(new C5Compare()); tables.put(tableName, tablets); } Tablet replacement = tablets.put(rowKey, tablet); if (replacement != null) { LOG.error("We replaced a tablet inadvertently" + replacement.toString()); } return tablet; } TabletRegistry(C5Server c5server,
                        ConfigDirectory configDirectory,
                        Configuration legacyConf,
                        Channel<TabletStateChange> commonStateChangeChannel,
                        ReplicationModule replicationModule,
                        TabletFactory tabletFactory,
                        Region.Creator regionCreator); void startOnDiskRegions(); Tablet startTablet(HRegionInfo regionInfo,
                            HTableDescriptor tableDescriptor,
                            List<Long> peerList); Tablet getTablet(String tableName, byte[] row); Tablet getTablet(String tableName, ByteBuffer row); Collection<Tablet> dumpTablets(); ConcurrentSkipListMap<byte[], Tablet> getTablets(String tableName);  }### Answer:
@Test public void shouldStartTabletWhenRequestedTo() throws Throwable { context.checking(new Expectations() {{ oneOf(configDirectory).writePeersToFile(ROOT_QUORUM_NAME, peerList); oneOf(configDirectory).writeBinaryData(ROOT_QUORUM_NAME, ConfigDirectory.htableDescriptorFile, rootTableDescriptorBytes); oneOf(configDirectory).writeBinaryData(ROOT_QUORUM_NAME, ConfigDirectory.regionInfoFile, regionInfoBytes); allowing(configDirectory).getBaseConfigPath(); }}); tabletRegistry.startTablet(rootRegionInfo, rootTableDescriptor, peerList); }