public TurnServerOptions getRoutingFor(
      @Nonnull final UUID aci,
      @Nonnull final Optional<InetAddress> clientAddress,
      final int instanceLimit
  ) {
    try {
      return getRoutingForInner(aci, clientAddress, instanceLimit);
    } catch(Exception e) {
      logger.error("Failed to perform routing", e);
      return new TurnServerOptions(this.configTurnRouter.getHostname(), null, this.configTurnRouter.randomUrls());
    }
  }
@Test
  public void testOrderedByPerformance() throws UnknownHostException {
    when(performanceTable.getDatacentersFor(any(), any(), any(), any()))
        .thenReturn(List.of("dc-performance2", "dc-performance1"));

    assertThat(router().getRoutingFor(aci, Optional.of(InetAddress.getByName("0.0.0.1")), 10))
        .isEqualTo(optionsWithUrls(List.of(
            "turn:9.9.9.3",
            "turn:9.9.9.3:80?transport=tcp",
            "turns:9.9.9.3:443?transport=tcp",

            "turn:9.9.9.1",
            "turn:9.9.9.1:80?transport=tcp",
            "turns:9.9.9.1:443?transport=tcp",

            "turn:9.9.9.2",
            "turn:9.9.9.2:80?transport=tcp",
            "turns:9.9.9.2:443?transport=tcp",

            "turn:[2222:1111:0:abc2:0:0:0:0]",
            "turn:[2222:1111:0:abc2:0:0:0:0]:80?transport=tcp",
            "turns:[2222:1111:0:abc2:0:0:0:0]:443?transport=tcp",

            "turn:[2222:1111:0:abc0:0:0:0:0]",
            "turn:[2222:1111:0:abc0:0:0:0:0]:80?transport=tcp",
            "turns:[2222:1111:0:abc0:0:0:0:0]:443?transport=tcp",

            "turn:[2222:1111:0:abc1:0:0:0:0]",
            "turn:[2222:1111:0:abc1:0:0:0:0]:80?transport=tcp",
            "turns:[2222:1111:0:abc1:0:0:0:0]:443?transport=tcp"
        )));
  }