@Test
  void testGetSupportedMethods() {
    MiningCoordinator miningCoordinator = mock(MergeMiningCoordinator.class);
    when(miningCoordinator.isCompatibleWithEngineApi()).thenReturn(true);
    ProtocolSchedule protocolSchedule = mock(ProtocolSchedule.class);
    when(protocolSchedule.milestoneFor(any())).thenReturn(Optional.of(0L));
    ExecutionEngineJsonRpcMethods methods =
        new ExecutionEngineJsonRpcMethods(
            miningCoordinator,
            protocolSchedule,
            mock(ProtocolContext.class),
            mock(EthPeers.class),
            mock(Vertx.class),
            "testClient",
            "testCommit",
            mock(TransactionPool.class),
            mock(MetricsSystem.class));

    Map<String, JsonRpcMethod> engineMethods = methods.create();
    List<String> expectedMethodNames =
        Arrays.stream(RpcMethod.values())
            .map(RpcMethod::getMethodName)
            .filter(name -> name.startsWith("engine_"))
            .toList();

    // All expected method names should be present in the result
    for (String expectedMethod : expectedMethodNames) {
      assertThat(engineMethods)
          .as("Method '%s' should be present in engine methods", expectedMethod)
          .containsKey(expectedMethod);
    }

    // All keys in the map starting with "engine_" must be valid method names
    for (String actualMethod : engineMethods.keySet()) {
      if (actualMethod.startsWith("engine_")) {
        assertThat(expectedMethodNames)
            .as("Unexpected engine method: '%s'", actualMethod)
            .contains(actualMethod);
      }
    }
  }
Ensures that all methods returned by create() are valid and declared "engine_" methods. This
protects against accidental omissions from the RpcMethod enum, which is used by
engine_exchangeCapabilities
ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/ExecutionEngineJsonRpcMethodsTest.java