@VisibleForTesting
    String[] findClassNames(AbstractConfiguration config) {

        // Find individually-specified filter classes.
        String[] filterClassNamesStrArray = config.getStringArray("zuul.filters.classes");
        Stream<String> classNameStream =
                Arrays.stream(filterClassNamesStrArray).map(String::trim).filter(blank.negate());

        // Find filter classes in specified packages.
        String[] packageNamesStrArray = config.getStringArray("zuul.filters.packages");
        ClassPath cp;
        try {
            cp = ClassPath.from(this.getClass().getClassLoader());
        } catch (IOException e) {
            throw new RuntimeException("Error attempting to read classpath to find filters!", e);
        }
        Stream<String> packageStream = Arrays.stream(packageNamesStrArray)
                .map(String::trim)
                .filter(blank.negate())
                .flatMap(packageName -> cp.getTopLevelClasses(packageName).stream())
                .map(ClassPath.ClassInfo::load)
                .filter(ZuulFilter.class::isAssignableFrom)
                .map(Class::getCanonicalName);

        String[] filterClassNames =
                Stream.concat(classNameStream, packageStream).toArray(String[]::new);
        if (filterClassNames.length != 0) {
            LOG.info("Using filter classnames: ");
            for (String location : filterClassNames) {
                LOG.info("  {}", location);
            }
        }

        return filterClassNames;
    }
@Test
    void testMultiPackages() {
        Class<?> expectedClass1 = TestZuulFilter.class;
        Class<?> expectedClass2 = TestZuulFilter2.class;

        Mockito.when(configuration.getStringArray("zuul.filters.classes")).thenReturn(new String[0]);
        Mockito.when(configuration.getStringArray("zuul.filters.packages"))
                .thenReturn(new String[] {"com.netflix.zuul.init", "com.netflix.zuul.init2"});

        String[] classNames = module.findClassNames(configuration);

        assertThat(classNames.length, equalTo(2));
        assertThat(classNames[0], equalTo(expectedClass1.getCanonicalName()));
        assertThat(classNames[1], equalTo(expectedClass2.getCanonicalName()));
    }