Repository: open-telemetry/opentelemetry-java
File: exporters/otlp/testing-internal/src/main/java/io/opentelemetry/exporter/otlp/testing/internal/AbstractGrpcTelemetryExporterTest.java (Java)

Code before:
            .setEndpoint("http://localhost:4317")
            .setCompression("gzip")
            .addHeader("foo", "bar")
            .setTrustedCertificates(certificate.certificate().getEncoded())
            .setClientTls(
                Files.readAllBytes(clientCertificate.privateKeyFile().toPath()),
                Files.readAllBytes(clientCertificate.certificateFile().toPath()))
            .setRetryPolicy(
                RetryPolicy.builder()
                    .setMaxAttempts(2)
                    .setMaxBackoff(Duration.ofSeconds(3))
                    .setInitialBackoff(Duration.ofMillis(50))
                    .setBackoffMultiplier(1.3)
                    .build())
            .build()) {
      Object unwrapped = exporter.unwrap();
      Field builderField = unwrapped.getClass().getDeclaredField("builder");
      builderField.setAccessible(true);

      // Builder copy should be equal to original when unchanged
      TelemetryExporter<T> copy = toBuilder(exporter).build();
      try {
        assertThat(copy.unwrap())
            .extracting("builder")
            .usingRecursiveComparison()
            .ignoringFields("tlsConfigHelper")
            .isEqualTo(builderField.get(unwrapped));
      } finally {
        copy.shutdown();
      }

      // Builder copy should NOT be equal when changed
      copy = toBuilder(exporter).addHeader("baz", "qux").build();
      try {
        assertThat(copy.unwrap())
            .extracting("builder")
            .usingRecursiveComparison()
            .ignoringFields("tlsConfigHelper")
            .isNotEqualTo(builderField.get(unwrapped));
      } finally {
        copy.shutdown();
      }
    }
  }

  @Test
  void stringRepresentation() throws IOException, CertificateEncodingException {
    try (TelemetryExporter<T> telemetryExporter =
        exporterBuilder().setEndpoint("http://localhost:4317").build()) {
      assertThat(telemetryExporter.unwrap().toString())
          .matches(

Review comment (suggestion):
here's the Javadoc for this method: https://javadoc.io/static/org.assertj/assertj-core/3.24.2/org/assertj/core/api/RecursiveComparisonAssert.html#withStrictTypeChecking()

Code after:
            .setEndpoint("http://localhost:4317")
            .setCompression("gzip")
            .addHeader("foo", "bar")
            .setTrustedCertificates(certificate.certificate().getEncoded())
            .setClientTls(
                Files.readAllBytes(clientCertificate.privateKeyFile().toPath()),
                Files.readAllBytes(clientCertificate.certificateFile().toPath()))
            .setRetryPolicy(
                RetryPolicy.builder()
                    .setMaxAttempts(2)
                    .setMaxBackoff(Duration.ofSeconds(3))
                    .setInitialBackoff(Duration.ofMillis(50))
                    .setBackoffMultiplier(1.3)
                    .build())
            .build()) {
      Object unwrapped = exporter.unwrap();
      Field builderField = unwrapped.getClass().getDeclaredField("builder");
      builderField.setAccessible(true);

      // Builder copy should be equal to original when unchanged
      TelemetryExporter<T> copy = toBuilder(exporter).build();
      try {
        assertThat(copy.unwrap())
            .extracting("builder")
            .usingRecursiveComparison()
            .withStrictTypeChecking()
            .ignoringFields("tlsConfigHelper")
            .isEqualTo(builderField.get(unwrapped));
      } finally {
        copy.shutdown();
      }

      // Builder copy should NOT be equal when changed
      copy = toBuilder(exporter).addHeader("baz", "qux").build();
      try {
        assertThat(copy.unwrap())
            .extracting("builder")
            .usingRecursiveComparison()
            .withStrictTypeChecking()
            .ignoringFields("tlsConfigHelper")
            .isNotEqualTo(builderField.get(unwrapped));
      } finally {
        copy.shutdown();
      }
    }
  }

  @Test
  void stringRepresentation() throws IOException, CertificateEncodingException {
    try (TelemetryExporter<T> telemetryExporter =
        exporterBuilder().setEndpoint("http://localhost:4317").build()) {