### Question:
ClientHello { public static ClientHello defaults(final KeyExchange ke, final Extension... exts) { final byte[] clientRandom = Rnd.rndBytes(32); final byte[] sessionId = new byte[0]; final List<CipherSuite> cipherSuites = CipherSuite.SUPPORTED; final List<Extension> extensions = ImmutableList.<Extension>builder() .add( KeyShare.of(ke.getGroup(), ke.getPublicKey()), SignatureAlgorithms.defaults(), new SupportedGroups(Group.X25519), SupportedVersions.TLS13, PskKeyExchangeModes.defaults(), new ALPN(List.of("h3-20"))) .add(exts) .build(); return new ClientHello(clientRandom, sessionId, cipherSuites, extensions); } ClientHello(
      final byte[] clientRandom,
      final byte[] sessionId,
      final List<CipherSuite> cipherSuites,
      final List<Extension> extensions); static ClientHello defaults(final KeyExchange ke, final Extension... exts); static ClientHello parse(final byte[] ch, final boolean isClient); byte[] getClientRandom(); byte[] getSessionId(); List<CipherSuite> getCipherSuites(); List<Extension> getExtensions(); Optional<Extension> getExtension(final ExtensionType type); void write(final ByteBuf bb, final boolean isClient); @Override String toString();  }### Answer:
@Test public void defaults() { final KeyExchange kek = KeyExchange.generate(Group.X25519); final ClientHello ch = ClientHello.defaults(kek, TestUtil.tps()); assertEquals(32, ch.getClientRandom().length); assertEquals(0, ch.getSessionId().length); assertEquals(List.of(TLS_AES_128_GCM_SHA256), ch.getCipherSuites()); final KeyShare keyShare = (KeyShare) ch.getExtension(ExtensionType.KEY_SHARE).get(); assertEquals(1, keyShare.getKeys().size()); assertEquals(Hex.hex(kek.getPublicKey()), Hex.hex(keyShare.getKey(Group.X25519).get())); final SupportedGroups supportedGroups = (SupportedGroups) ch.getExtension(ExtensionType.SUPPORTED_GROUPS).get(); assertEquals(List.of(Group.X25519), supportedGroups.getGroups()); final SupportedVersions supportedVersions = (SupportedVersions) ch.getExtension(ExtensionType.SUPPORTED_VERSIONS).get(); assertEquals(List.of(SupportedVersion.TLS13), supportedVersions.getVersions()); final TransportParameters transportParameters = (TransportParameters) ch.getExtension(ExtensionType.QUIC).get(); assertEquals(TestUtil.tps(), transportParameters); }