public RegionSizeCalculator getRegionSizeCalculator() {
      RegionSizeCalculator sizeCalculator = mock(RegionSizeCalculator.class);
      when(sizeCalculator.getRegionSize(any(byte[].class))).thenAnswer(new Answer<Long>() {
        @Override
        public Long answer(InvocationOnMock invocationOnMock) throws Throwable {
          Object[] args = invocationOnMock.getArguments();
          byte[] regionId = (byte[]) args[0];
          byte[] startKey = RegionInfo.getStartKey(regionId);
          return SIZE_MAP.get(startKey);
        }
      });
      return sizeCalculator;
    }
Connection class to use in {@link #testNonSuccessiveSplitsAreNotMerged}. This class returns
mocked {@link Table}, {@link RegionLocator}, {@link RegionSizeCalculator}, and {@link Admin}.
hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableInputFormatBase.java