LayeredCRUDAccessor implements CRUDAccessor<T> { public void addAccessor(CRUDAccessor<T> accessor) { accessors.add(accessor); } LayeredCRUDAccessor();  LayeredCRUDAccessor(List<? extends CRUDAccessor<T>> accessors); void addAccessor(CRUDAccessor<T> accessor); void pushAccessor(CRUDAccessor<T> accessor); @Override T get(ObjectId id); @Override T get(String id); @Override T findByAttributes(Map<String, String> attributes); @Override Spliterator<T> findManyByAttributes(Map<String, String> attributes); @Override Iterator<T> getAll(); @Override T findByAttributes(Map<String, String> attributes, String attributesMapKey); @Override Spliterator<T> findManyByAttributes(Map<String, String> attributes, String attributesMapKey); @Override List<T> getRange(int skip, int limit); @Override void remove(ObjectId id); @Override T save(T entity); @Override void save(Collection<? extends T> entities);  }
@Test public void test2() { LayeredCRUDAccessor<AbstractOrganizableObject> accessor = new LayeredCRUDAccessor<>(); accessor.addAccessor(accessor1); accessor.addAccessor(accessor2); performTests(accessor); }