public class DefaultInputs implements Inputs {
private final ImmutableList<ModelElement<?>> inputs;
public DefaultInputs(ImmutableList<ModelElement<?>> inputs) {
this.inputs = inputs;
}
<BUG>public <T> ModelElement<? extends T> get(int i, Class<T> type) {
</BUG>
ModelElement<?> input = inputs.get(i);
<BUG>if (new ModelType<T>(type).isAssignableFrom(input.getReference().getType())) {
@SuppressWarnings("unchecked") ModelElement<? extends T> cast = (ModelElement<? extends T>) input;</BUG>
return cast;

public class DefaultInputs implements Inputs {
private final ImmutableList<ModelElement<?>> inputs;
public DefaultInputs(ImmutableList<ModelElement<?>> inputs) {
this.inputs = inputs;
}
public <T> ModelElement<? extends T> get(int i, ModelType<T> type) {
ModelElement<?> input = inputs.get(i);
if (type.isAssignableFrom(input.getReference().getType())) {
@SuppressWarnings("unchecked") ModelElement<? extends T> cast = (ModelElement<? extends T>) input;
return cast;
