public void assertPendingTransactionCounts(final int... expected) {
    checkNotNull(expected);
    checkArgument(
        expected.length == nodes.size(),
        "Expected values for %s nodes, but got %s.",
        expected.length,
        nodes.size());
    int errCnt = 0;
    final StringBuilder sb = new StringBuilder();
    int i = 0;
    for (final TestNode node : nodes) {
      final int expectedCnt = expected[i];
      try {
        Awaitility.await()
            .atMost(MSG_WAIT)
            .until(() -> node.getPendingTransactionCount() == expectedCnt);
      } catch (final ConditionTimeoutException e) {
        /* Ignore ConditionTimeoutException.  We just want a fancy wait here.  The real check will happen
          below and has a proper exception message
        */
      }

      final int actual = node.getPendingTransactionCount();
      if (actual != expected[i]) {
        errCnt++;
        final String msg =
            format(
                "Node %s expected %d pending txs, but has %d.\n",
                node.shortId(), expected[i], actual);
        sb.append(msg);
      }
      i++;
    }
    final String header = "Nodes have " + errCnt + " incorrect Pending Tx pool sizes.\n";
    assertThat(errCnt).describedAs(header + sb).isEqualTo(0);
  }
Assert that all Nodes have exactly 1 connection to each other node
ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/transactions/TestNodeList.java