docs: private static Platform findPlatform() {
      Provider androidOrAppEngineProvider =
          GrpcUtil.IS_RESTRICTED_APPENGINE ? getAppEngineProvider() : getAndroidSecurityProvider();
      if (androidOrAppEngineProvider != null) {
        // Attempt to find Android 2.3+ APIs.
        OptionalMethod<Socket> setUseSessionTickets
            = new OptionalMethod<>(null, "setUseSessionTickets", boolean.class);
        OptionalMethod<Socket> setHostname
            = new OptionalMethod<>(null, "setHostname", String.class);
        Method trafficStatsTagSocket = null;
        Method trafficStatsUntagSocket = null;
        OptionalMethod<Socket> getAlpnSelectedProtocol =
            new OptionalMethod<>(byte[].class, "getAlpnSelectedProtocol");
        OptionalMethod<Socket> setAlpnProtocols =
            new OptionalMethod<>(null, "setAlpnProtocols", byte[].class);
  
        // Attempt to find Android 4.0+ APIs.
        try {
          Class<?> trafficStats = Class.forName("android.net.TrafficStats");
          trafficStatsTagSocket = trafficStats.getMethod("tagSocket", Socket.class);
          trafficStatsUntagSocket = trafficStats.getMethod("untagSocket", Socket.class);
        } catch (ClassNotFoundException ignored) {
        } catch (NoSuchMethodException ignored) {
        }
  
        TlsExtensionType tlsExtensionType;
        if (GrpcUtil.IS_RESTRICTED_APPENGINE) {
          tlsExtensionType = TlsExtensionType.ALPN_AND_NPN;
        } else if (androidOrAppEngineProvider.getName().equals("GmsCore_OpenSSL")
            || androidOrAppEngineProvider.getName().equals("Conscrypt")
            || androidOrAppEngineProvider.getName().equals("Ssl_Guard")) {
          tlsExtensionType = TlsExtensionType.ALPN_AND_NPN;
        } else if (isAtLeastAndroid5()) {
          tlsExtensionType = TlsExtensionType.ALPN_AND_NPN;
        } else if (isAtLeastAndroid41()) {
          tlsExtensionType = TlsExtensionType.NPN;
        } else {
          tlsExtensionType = TlsExtensionType.NONE;
        }
        return new Android(
            setUseSessionTickets,
            setHostname,
            trafficStatsTagSocket,
            trafficStatsUntagSocket,
            getAlpnSelectedProtocol,
            setAlpnProtocols,
            androidOrAppEngineProvider,
            tlsExtensionType);
      }
      Provider sslProvider;
      try {
        sslProvider = SSLContext.getDefault().getProvider();
      } catch (NoSuchAlgorithmException nsae) {
        throw new RuntimeException(nsae);
      }
  
      // Find JDK9+ ALPN support
      try {
        // getApplicationProtocol() may throw UnsupportedOperationException, so first construct a
        // dummy SSLEngine and verify the method does not throw.
        SSLContext context = SSLContext.getInstance("TLS", sslProvider);
        context.init(null, null, null);
        SSLEngine engine = context.createSSLEngine();
        Method getEngineApplicationProtocol =
            AccessController.doPrivileged(
                new PrivilegedExceptionAction<Method>() {
                  @Override
                  public Method run() throws Exception {
                    return SSLEngine.class.getMethod("getApplicationProtocol");
                  }
                });
        getEngineApplicationProtocol.invoke(engine);
  
        Method setApplicationProtocols =
            AccessController.doPrivileged(
                new PrivilegedExceptionAction<Method>() {
                  @Override
                  public Method run() throws Exception {
                    return SSLParameters.class.getMethod("setApplicationProtocols", String[].class);
                  }
                });
        Method getApplicationProtocol =
            AccessController.doPrivileged(
                new PrivilegedExceptionAction<Method>() {
                  @Override
                  public Method run() throws Exception {
                    return SSLSocket.class.getMethod("getApplicationProtocol");
                  }
                });
        return new JdkAlpnPlatform(sslProvider, setApplicationProtocols, getApplicationProtocol);
      } catch (NoSuchAlgorithmException ignored) {
      } catch (KeyManagementException ignored) {
      } catch (PrivilegedActionException ignored) {
      } catch (IllegalAccessException ignored) {
      } catch (InvocationTargetException ignored) {
      }
  
      // Find Jetty's ALPN extension for OpenJDK.
      try {
        String negoClassName = "org.eclipse.jetty.alpn.ALPN";
        Class<?> negoClass = Class.forName(negoClassName);
        Class<?> providerClass = Class.forName(negoClassName + "$Provider");
        Class<?> clientProviderClass = Class.forName(negoClassName + "$ClientProvider");
        Class<?> serverProviderClass = Class.forName(negoClassName + "$ServerProvider");
        Method putMethod = negoClass.getMethod("put", SSLSocket.class, providerClass);
        Method getMethod = negoClass.getMethod("get", SSLSocket.class);
        Method removeMethod = negoClass.getMethod("remove", SSLSocket.class);
        return new JdkWithJettyBootPlatform(
            putMethod, getMethod, removeMethod, clientProviderClass, serverProviderClass,
            sslProvider);
      } catch (ClassNotFoundException ignored) {
      } catch (NoSuchMethodException ignored) {
      }
  
      // TODO(ericgribkoff) Return null here
      return new Platform(sslProvider);
    }