@Test
  public void regionStateFilter() {
    final String namespaceName = testNameRule.getMethodName();
    final TableName foo = TableName.valueOf(namespaceName, "foo");
    final TableName bar = TableName.valueOf(namespaceName, "bar");

    createNamespace(namespaceName)
      .thenCompose(_void1 -> CompletableFuture.allOf(
        createTable(foo, 2).thenCompose(_void2 -> admin.disableTable(foo)), createTable(bar, 2)))
      .join();

    final HttpServletRequest request = new MockRequestBuilder().setLimit(10_000)
      .setRegionState(RegionState.State.OPEN).setTable(namespaceName).build();
    final List<RegionReplicaInfo> rows;
    try (final MetaBrowser.Results results = new MetaBrowser(connection, request).getResults()) {
      rows = IterableUtils.toList(results);
    }
    assertThat(rows,
      contains(hasProperty("row", bytesAsStringBinary(startsWith(bar.toString() + ",,"))),
        hasProperty("row", bytesAsStringBinary(startsWith(bar.toString() + ",80000000")))));
  }
Cluster-backed correctness tests for the functionality provided by {@link MetaBrowser}.
hbase-server/src/test/java/org/apache/hadoop/hbase/master/http/TestMetaBrowser.java