@Override
    public String[] filterCipherSuites(Iterable<String> ciphers, List<String> defaultCiphers,
            Set<String> supportedCiphers) {
        if (ciphers == null) {
            return defaultToDefaultCiphers ?
                    defaultCiphers.toArray(EmptyArrays.EMPTY_STRINGS) :
                    supportedCiphers.toArray(EmptyArrays.EMPTY_STRINGS);
        } else {
            List<String> newCiphers = new ArrayList<String>(supportedCiphers.size());
            for (String c : ciphers) {
                if (c == null) {
                    break;
                }
                newCiphers.add(c);
            }
            return newCiphers.toArray(EmptyArrays.EMPTY_STRINGS);
        }
    }
@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);
    }