TypedIndexedObjectContainer implements ObjectIndexProvider { public boolean containsObject( @Nonnull IdentifiableObject object ) { final IndexedObjectContainer indexedObjectContainer = typedIndexedObjectContainers.get( object.getClass() ); return indexedObjectContainer != null && indexedObjectContainer.containsObject( object ); }  @Nonnull IndexedObjectContainer getTypedContainer( @Nonnull Class<? extends IdentifiableObject> c ); @Nonnull @Override Integer mergeObjectIndex( @Nonnull IdentifiableObject object ); boolean containsObject( @Nonnull IdentifiableObject object ); void add( @Nonnull IdentifiableObject identifiableObject );  }
@Test public void containsObject() { final Category category1 = new Category(); final Category category2 = new Category(); container.add( category1 ); container.add( category2 ); Assert.assertTrue( container.containsObject( category1 ) ); }