@PatchMethod
static <T> ScopedBindingBuilder bind(LinkedBindingBuilder<T> builder) {
if (!(builder instanceof AbstractBindingBuilder)) {
throw new GwtTestGinException("Not managed " + LinkedBindingBuilder.class.getSimpleName()
+ " implementation : " + builder.getClass().getName());
}
Binding<T> binding = GwtReflectionUtils.<Binding<T>> getPrivateFieldValue(builder, "binding");
Type type = binding.getKey().getTypeLiteral().getType();
if (!(type instanceof Class)) {
throw new GwtTestGinException("Not managed binded type : " + type);
}
Constructor<T> atInjectConstructor = getAtInjectConstructor((Class<T>) type);
if (atInjectConstructor != null) {
return builder.toConstructor(atInjectConstructor);