ComponentGraph { public static boolean isBindingAnnotation(Annotation annotation) { LinkedList<Class<?>> queue = new LinkedList<>(); queue.add(annotation.getClass()); queue.addAll(Arrays.asList(annotation.getClass().getInterfaces())); while (!queue.isEmpty()) { Class<?> clazz = queue.removeFirst(); if (clazz.getAnnotation(BindingAnnotation.class) != null) { return true; } else { if (clazz.getSuperclass() != null) { queue.addFirst(clazz.getSuperclass()); } } } return false; } ComponentGraph(long generation);  ComponentGraph(); long generation(); int size(); Collection<Node> nodes(); void add(Node component); T getInstance(Class<T> clazz); @SuppressWarnings("unchecked") T getInstance(Key<T> key); List<Node> complete(Injector fallbackInjector); List<Node> complete(); Set<ConfigKey<? extends ConfigInstance>> configKeys(); void setAvailableConfigs(Map<ConfigKey<? extends ConfigInstance>, ConfigInstance> configs); void reuseNodes(ComponentGraph old); List<Object> allConstructedComponentsAndProviders(); static Node getNode(ComponentGraph graph, String componentId); static boolean isBindingAnnotation(Annotation annotation);  }
@Test public void check_if_annotation_is_a_binding_annotation() { assertTrue(isBindingAnnotation(Names.named("name"))); assertFalse(isBindingAnnotation(Named.class.getAnnotations()[0])); }