@Override public void validate() throws DefinitionException { super.validate(); for (AnnotatedParameter<?> parameter : annotatedMember.getParameters()) { Type type = parameter.getBaseType(); if (Bean.class.equals(ClassUtil.getClass(type)) && !annotatedMember.getBaseType().equals(ClassUtil.getActualTypeArguments(type)[0])) { throw new WebBeansConfigurationException("Type parameter of the injected bean must be the same as the return type. Producer method: " + annotatedMember); } } } }