public AsyncConnection getAsyncConnection() {
    if (asyncConnection == null) {
      throw new IllegalStateException(
        "ConnectionRule not initialized with an asynchronous connection.");
    }
    return asyncConnection;
  }
A {@link Rule} that manages the lifecycle of an instance of {@link AsyncConnection}. Can be used
in either the {@link Rule} or {@link ClassRule} positions.
</p>
Use in combination with {@link MiniClusterRule}, for example:

<pre>
{
  &#64;code
  public class TestMyClass {
    private static final MiniClusterRule miniClusterRule = MiniClusterRule.newBuilder().build();
    private static final ConnectionRule connectionRule =
      ConnectionRule.createAsyncConnectionRule(miniClusterRule::createConnection);

    &#64;ClassRule
    public static final TestRule rule =
      RuleChain.outerRule(miniClusterRule).around(connectionRule);
  }
}
</pre>
hbase-server/src/test/java/org/apache/hadoop/hbase/ConnectionRule.java