}
public CompositeObjectRegistrationBuilder<T> add(final ObjectRegistration<? super T> registration) {
- if (registration.getInstance() != instance) {
+ if (!registration.getInstance().equals(instance)) {
throw new IllegalArgumentException("Instance must be same.");
}
registrations.add(registration);
}
public CompositeObjectRegistrationBuilder<T> remove(final ObjectRegistration<? super T> registration) {
- if (registration.getInstance() != instance) {
+ if (!registration.getInstance().equals(instance)) {
throw new IllegalArgumentException("Instance must be same.");
}
registrations.remove(registration);