protected List<ClientInterceptor> interceptorsFromAnnotation(final GrpcClient annotation) throws BeansException {
        final List<ClientInterceptor> list = Lists.newArrayList();
        for (final Class<? extends ClientInterceptor> interceptorClass : annotation.interceptors()) {
            final ClientInterceptor clientInterceptor;
            if (this.applicationContext.getBeanNamesForType(interceptorClass).length > 0) {
                clientInterceptor = this.applicationContext.getBean(interceptorClass);
            } else {
                try {
                    clientInterceptor = interceptorClass.getConstructor().newInstance();
                } catch (final Exception e) {
                    throw new BeanCreationException("Failed to create interceptor instance", e);
                }
            }
            list.add(clientInterceptor);
        }
        for (final String interceptorName : annotation.interceptorNames()) {
            list.add(this.applicationContext.getBean(interceptorName, ClientInterceptor.class));
        }
        return list;
    }
@Test
    void testInterceptorsFromAnnotation2() {
        final List<ClientInterceptor> beans =
                assertDoesNotThrow(() -> this.postProcessor.interceptorsFromAnnotation(new GrpcClient() {

                    @Override
                    public Class<? extends Annotation> annotationType() {
                        return GrpcClient.class;
                    }

                    @Override
                    public String value() {
                        return "test";
                    }

                    @Override
                    public boolean sortInterceptors() {
                        return false;
                    }

                    @Override
                    @SuppressWarnings("unchecked")
                    public Class<? extends ClientInterceptor>[] interceptors() {
                        return new Class[] {Interceptor2.class};
                    }

                    @Override
                    public String[] interceptorNames() {
                        return new String[0];
                    }

                }));

        assertThat(beans).hasSize(1).doesNotContain(this.interceptor1);
    }