@Before
  public void before() throws Exception {
    MockitoAnnotations.initMocks(this);
    when(masterServices.skipRegionManagementAction(any())).thenReturn(false);
    testingUtility = new HBaseCommonTestingUtil();
    queue = new RegionNormalizerWorkQueue<>();
    workerThreadThrowable.set(null);

    final String threadNameFmt =
      TestRegionNormalizerWorker.class.getSimpleName() + "-" + testName.getMethodName() + "-%d";
    final ThreadFactory threadFactory = new ThreadFactoryBuilder().setNameFormat(threadNameFmt)
      .setDaemon(true).setUncaughtExceptionHandler((t, e) -> workerThreadThrowable.set(e)).build();
    workerPool = Executors.newSingleThreadExecutor(threadFactory);
  }
A test over {@link RegionNormalizerWorker}. Being a background thread, the only points of
interaction we have to this class are its input source ({@link RegionNormalizerWorkQueue} and its
callbacks invoked against {@link RegionNormalizer} and {@link MasterServices}. The work queue is
simple enough to use directly; for {@link MasterServices}, use a mock because, as of now, the
worker only invokes 4 methods.
hbase-server/src/test/java/org/apache/hadoop/hbase/master/normalizer/TestRegionNormalizerWorker.java