bindConstant().annotatedWith(Names.named("b")).to("B");
}});
Binding<Set<String>> binding = injector.getBinding(new Key<Set<String>>() {});
HasDependencies withDependencies = (HasDependencies) binding;
InstanceBinding<?> instanceBinding = null;
LinkedKeyBinding<?> linkedBinding = null;
// The non-tool stage test can test this by calling injector.getInstance to ensure
// the right values are returned -- in tool stage we can't do that. It's also a
// little difficult to validate the dependencies & bindings, because they're
// bindings created internally within Multibinder.
// To workaround this, we just validate that the dependencies lookup to a single
// InstanceBinding whose value is "A" and another LinkedBinding whose target is
// the Key of @Named("b") String=B
for (Dependency<?> dependency : withDependencies.getDependencies()) {
Binding<?> b = injector.getBinding(dependency.getKey());
if(b instanceof InstanceBinding) {
if(instanceBinding != null) {
fail("Already have an instance binding of: " + instanceBinding + ", and now want to add: " + b);
} else {