### Question:
FeignContext extends NamedContextFactory<FeignClientSpecification> { @Nullable public <T> Map<String, T> getInstancesWithoutAncestors(String name, Class<T> type) { return getContext(name).getBeansOfType(type); } FeignContext(); @Nullable T getInstanceWithoutAncestors(String name, Class<T> type); @Nullable Map<String, T> getInstancesWithoutAncestors(String name, Class<T> type);  }### Answer:
@Test public void getInstancesWithoutAncestors_verifyEmptyForMissing() { AnnotationConfigApplicationContext parent = new AnnotationConfigApplicationContext(); parent.refresh(); FeignContext feignContext = new FeignContext(); feignContext.setApplicationContext(parent); feignContext.setConfigurations(Lists.newArrayList(getSpec("empty", EmptyConfiguration.class))); Collection<RequestInterceptor> interceptors = feignContext .getInstancesWithoutAncestors("empty", RequestInterceptor.class).values(); assertThat(interceptors).as("Interceptors is not empty").isEmpty(); }
@Test public void getInstancesWithoutAncestors() { AnnotationConfigApplicationContext parent = new AnnotationConfigApplicationContext(); parent.refresh(); FeignContext feignContext = new FeignContext(); feignContext.setApplicationContext(parent); feignContext.setConfigurations(Lists.newArrayList(getSpec("demo", DemoConfiguration.class))); Collection<RequestInterceptor> interceptors = feignContext .getInstancesWithoutAncestors("demo", RequestInterceptor.class).values(); assertThat(interceptors.size()).isEqualTo(1); }