### Question:
DefaultWorkloadApiClient implements WorkloadApiClient { public static WorkloadApiClient newClient() throws SocketEndpointAddressException { val options = ClientOptions.builder().build(); return newClient(options); } private  DefaultWorkloadApiClient(final SpiffeWorkloadAPIStub workloadApiAsyncStub,
                                     final SpiffeWorkloadAPIBlockingStub workloadApiBlockingStub,
                                     final ManagedChannelWrapper managedChannel,
                                     final ExponentialBackoffPolicy exponentialBackoffPolicy,
                                     final ScheduledExecutorService retryExecutor,
                                     final ExecutorService executorService);   DefaultWorkloadApiClient(final SpiffeWorkloadAPIStub workloadApiAsyncStub,
                             final SpiffeWorkloadAPIBlockingStub workloadApiBlockingStub,
                             final ManagedChannelWrapper managedChannel,
                             final ExponentialBackoffPolicy backoffPolicy); static WorkloadApiClient newClient(); static WorkloadApiClient newClient(@NonNull final ClientOptions options); @Override X509Context fetchX509Context(); @Override void watchX509Context(@NonNull final Watcher<X509Context> watcher); @Override JwtSvid fetchJwtSvid(@NonNull String audience, String... extraAudience); @Override JwtSvid fetchJwtSvid(@NonNull final SpiffeId subject,
                                @NonNull final String audience,
                                final String... extraAudience); @Override JwtBundleSet fetchJwtBundles(); @Override JwtSvid validateJwtSvid(@NonNull final String token, @NonNull final String audience); @Override void watchJwtBundles(@NonNull final Watcher<JwtBundleSet> watcher); @Override void close();  }### Answer:
@Test void testNewClient_defaultOptions() throws Exception { try { TestUtils.setEnvironmentVariable(Address.SOCKET_ENV_VARIABLE, "unix:/tmp/agent.sock" ); WorkloadApiClient client = DefaultWorkloadApiClient.newClient(); assertNotNull(client); } catch (SocketEndpointAddressException e) { fail(e); } }
@Test void testNewClient_nullOptions() { try { DefaultWorkloadApiClient.newClient(null); } catch (NullPointerException e) { assertEquals("options is marked non-null but is null", e.getMessage()); } catch (SocketEndpointAddressException e) { fail(e); } }
@Test void testNewClient_customOptions() { try { DefaultWorkloadApiClient.ClientOptions options = DefaultWorkloadApiClient.ClientOptions .builder() .spiffeSocketPath("unix:/tmp/agent.sock") .executorService(Executors.newCachedThreadPool()) .exponentialBackoffPolicy(ExponentialBackoffPolicy.DEFAULT) .build(); WorkloadApiClient client = DefaultWorkloadApiClient.newClient(options); assertNotNull(client); } catch (SocketEndpointAddressException e) { fail(e); } }