Source:
<code>public <T> Collection<Binding<T>> bindConsumer(T input, String inputName) { Collection<Binding<T>> bindings = new ArrayList<>(); Binder<T, ConsumerProperties, ?> binder = (Binder<T, ConsumerProperties, ?>) getBinder( inputName, input.getClass()); ConsumerProperties consumerProperties = this.bindingServiceProperties .getConsumerProperties(inputName); if (binder instanceof ExtendedPropertiesBinder) { Object extension = ((ExtendedPropertiesBinder) binder) .getExtendedConsumerProperties(inputName); ExtendedConsumerProperties extendedConsumerProperties = new ExtendedConsumerProperties( extension); BeanUtils.copyProperties(consumerProperties, extendedConsumerProperties); consumerProperties = extendedConsumerProperties; } validate(consumerProperties); String bindingTarget = this.bindingServiceProperties .getBindingDestination(inputName); if (consumerProperties.isMultiplex()) { bindings.add(doBindConsumer(input, inputName, binder, consumerProperties, bindingTarget)); } else { String[] bindingTargets = StringUtils .commaDelimitedListToStringArray(bindingTarget); for (String target : bindingTargets) { <START> if (consumerProperties.getInstanceIndexList().isEmpty()) { <END> Binding<T> binding = input instanceof PollableSource ? doBindPollableConsumer(input, inputName, binder, consumerProperties, target) : doBindConsumer(input, inputName, binder, consumerProperties, target); bindings.add(binding); } else { for (Integer index : consumerProperties.getInstanceIndexList()) { if (index < 0) { continue; } ConsumerProperties consumerPropertiesTemp = new ExtendedConsumerProperties<>(""); BeanUtils.copyProperties(consumerProperties, consumerPropertiesTemp); consumerPropertiesTemp.setInstanceIndex(index); Binding<T> binding = input instanceof PollableSource ? doBindPollableConsumer(input, inputName, binder, consumerPropertiesTemp, target) : doBindConsumer(input, inputName, binder, consumerPropertiesTemp, target); bindings.add(binding); } } } } bindings = Collections.unmodifiableCollection(bindings); this.consumerBindings.put(inputName, new ArrayList<>(bindings)); return bindings; }</code><technical_language>null, ObjectUtils.isEmpty() for a null-safe test here</technical_language>

Target:
public <T> Collection<Binding<T>> bindConsumer(T input, String inputName) { Collection<Binding<T>> bindings = new ArrayList<>(); Binder<T, ConsumerProperties, ?> binder = (Binder<T, ConsumerProperties, ?>) getBinder( inputName, input.getClass()); ConsumerProperties consumerProperties = this.bindingServiceProperties .getConsumerProperties(inputName); if (binder instanceof ExtendedPropertiesBinder) { Object extension = ((ExtendedPropertiesBinder) binder) .getExtendedConsumerProperties(inputName); ExtendedConsumerProperties extendedConsumerProperties = new ExtendedConsumerProperties( extension); BeanUtils.copyProperties(consumerProperties, extendedConsumerProperties); consumerProperties = extendedConsumerProperties; } validate(consumerProperties); String bindingTarget = this.bindingServiceProperties .getBindingDestination(inputName); if (consumerProperties.isMultiplex()) { bindings.add(doBindConsumer(input, inputName, binder, consumerProperties, bindingTarget)); } else { String[] bindingTargets = StringUtils .commaDelimitedListToStringArray(bindingTarget); for (String target : bindingTargets) { if (ObjectUtils.isEmpty(consumerProperties.getInstanceIndexList())) { Binding<T> binding = input instanceof PollableSource ? doBindPollableConsumer(input, inputName, binder, consumerProperties, target) : doBindConsumer(input, inputName, binder, consumerProperties, target); bindings.add(binding); } else { for (Integer index : consumerProperties.getInstanceIndexList()) { if (index < 0) { continue; } ConsumerProperties consumerPropertiesTemp = new ExtendedConsumerProperties<>(""); BeanUtils.copyProperties(consumerProperties, consumerPropertiesTemp); consumerPropertiesTemp.setInstanceIndex(index); Binding<T> binding = input instanceof PollableSource ? doBindPollableConsumer(input, inputName, binder, consumerPropertiesTemp, target) : doBindConsumer(input, inputName, binder, consumerPropertiesTemp, target); bindings.add(binding); } } } } bindings = Collections.unmodifiableCollection(bindings); this.consumerBindings.put(inputName, new ArrayList<>(bindings)); return bindings; }