### Question:
GitSkipSslValidationCredentialsProvider extends CredentialsProvider { @Override public boolean supports(CredentialItem... items) { List<CredentialItem> unprocessedItems = new ArrayList<>(); for (CredentialItem item : items) { if (item instanceof CredentialItem.InformationalMessage && item.getPromptText() != null && item.getPromptText().contains(JGitText.get().sslFailureTrustExplanation)) { continue; } if (item instanceof CredentialItem.YesNoType && item.getPromptText() != null && (item.getPromptText().equals(JGitText.get().sslTrustNow) || item.getPromptText() .startsWith(stripFormattingPlaceholders(JGitText.get().sslTrustForRepo)) || item.getPromptText().equals(JGitText.get().sslTrustAlways))) { continue; } unprocessedItems.add(item); } return unprocessedItems.isEmpty() || (this.delegate != null && this.delegate.supports(unprocessedItems.toArray(new CredentialItem[0]))); } GitSkipSslValidationCredentialsProvider(CredentialsProvider delegate); static boolean canHandle(String uri); @Override boolean isInteractive(); @Override boolean supports(CredentialItem... items); @Override boolean get(URIish uri, CredentialItem... items); @Override void reset(URIish uri);  }### Answer:
@Test public void testSupportsUnrelatedCredentialItemTypes() { CredentialItem usernameCredentialItem = new CredentialItem.Username(); boolean supportsItems = this.skipSslValidationCredentialsProvider.supports(usernameCredentialItem); assertThat(supportsItems) .as("Credential item types not related to SSL validation skipping should not be supported").isFalse(); }
@Test public void testSupportsUnrelatedCredentialItemTypesWithDelegate() { this.skipSslValidationCredentialsProvider = new GitSkipSslValidationCredentialsProvider( this.mockDelegateCredentialsProvider); CredentialItem usernameCredentialItem = new CredentialItem.Username(); when(this.mockDelegateCredentialsProvider.supports(usernameCredentialItem)).thenReturn(true); boolean supportsItems = this.skipSslValidationCredentialsProvider.supports(usernameCredentialItem); assertThat(supportsItems).as( "GitSkipSslValidationCredentialsProvider must support the types supported by its delegate CredentialsProvider") .isTrue(); }