### Question:
S3FileSystemProvider implements FileSystemProvider { @Nonnull @VisibleForTesting Optional<AWSCredentialsProvider> getCustomCredentialsProvider(@Nonnull final URI uri, @Nonnull final Configuration conf) { return Optional.ofNullable(conf.getClass("fs.s3.customAWSCredentialsProvider", null)) .map(providerClass -> { try { return S3AUtils.createAWSCredentialProvider(conf, providerClass, uri); } catch (final IOException e) { throw new IllegalArgumentException("Unable to create S3 client: " + e, e); } }); }  @Nonnull @Override List<DataSetFile> listFiles(@Nonnull final Path path, @Nonnull final Configuration conf); @Override boolean supportsPath(@Nonnull final Path path);  }### Answer:
@Test @SuppressWarnings("squid:S3655") public void getCustomCredentialsProvider() { final S3FileSystemProvider provider = new S3FileSystemProvider(); Assert.assertFalse("Expected empty credentials", provider.getCustomCredentialsProvider(S3N, new Configuration(false)).isPresent()); final Configuration conf = new Configuration(false); conf.setClass("fs.s3.customAWSCredentialsProvider", EnvironmentVariableCredentialsProvider.class, AWSCredentialsProvider.class); final Optional<AWSCredentialsProvider> credentials = provider.getCustomCredentialsProvider(S3N, conf); Assert.assertTrue("Expected custom credentials", credentials.isPresent()); Assert.assertTrue("Expected EnvironmentVariableCredentialsProvider", credentials.get() instanceof EnvironmentVariableCredentialsProvider); }