### Question:
IdentityCipherSuiteFilter implements CipherSuiteFilter { @Override public String[] filterCipherSuites(Iterable<String> ciphers, List<String> defaultCiphers, Set<String> supportedCiphers) { if (ciphers == null) { return defaultToDefaultCiphers ? defaultCiphers.toArray(new String[defaultCiphers.size()]) : supportedCiphers.toArray(new String[supportedCiphers.size()]); } else { List<String> newCiphers = new ArrayList<String>(supportedCiphers.size()); for (String c : ciphers) { if (c == null) { break; } newCiphers.add(c); } return newCiphers.toArray(new String[newCiphers.size()]); } } private  IdentityCipherSuiteFilter(boolean defaultToDefaultCiphers); @Override String[] filterCipherSuites(Iterable<String> ciphers, List<String> defaultCiphers,
            Set<String> supportedCiphers); static final IdentityCipherSuiteFilter INSTANCE; static final IdentityCipherSuiteFilter INSTANCE_DEFAULTING_TO_SUPPORTED_CIPHERS; }### Answer:
@Test public void regularInstanceDefaultsToDefaultCiphers() { List<String> defaultCiphers = Arrays.asList("FOO", "BAR"); Set<String> supportedCiphers = new HashSet<String>(Arrays.asList("BAZ", "QIX")); String[] filtered = IdentityCipherSuiteFilter.INSTANCE .filterCipherSuites(null, defaultCiphers, supportedCiphers); assertArrayEquals(defaultCiphers.toArray(), filtered); }
@Test public void alternativeInstanceDefaultsToSupportedCiphers() { List<String> defaultCiphers = Arrays.asList("FOO", "BAR"); Set<String> supportedCiphers = new HashSet<String>(Arrays.asList("BAZ", "QIX")); String[] filtered = IdentityCipherSuiteFilter.INSTANCE_DEFAULTING_TO_SUPPORTED_CIPHERS .filterCipherSuites(null, defaultCiphers, supportedCiphers); assertArrayEquals(supportedCiphers.toArray(), filtered); }