IndexedObjectContainer implements ObjectIndexProvider { @Nonnull @Override public Integer mergeObjectIndex( @Nonnull IdentifiableObject object ) { return add( object ); }  @Nonnull @Override Integer mergeObjectIndex( @Nonnull IdentifiableObject object ); boolean containsObject( @Nonnull IdentifiableObject object );  }
@Test public void merge() { final Attribute attribute1 = new Attribute(); final Attribute attribute2 = new Attribute(); final Attribute attribute3 = new Attribute(); Assert.assertEquals( (Integer) 0, container.mergeObjectIndex( attribute1 ) ); Assert.assertEquals( (Integer) 1, container.mergeObjectIndex( attribute2 ) ); Assert.assertEquals( (Integer) 0, container.mergeObjectIndex( attribute1 ) ); Assert.assertEquals( (Integer) 2, container.mergeObjectIndex( attribute3 ) ); }