CommonTxDao implements CommonDao<T, String> { public <OtherTemplate> List<OtherTemplate> getOtherList(List<QueryParameter> query) { return this.readDao.<OtherTemplate>getOtherList(query); } @Inject  CommonTxDao(@Transactionable CommonReadDao<T, String> readDao,
                     @Transactionable CommonWriteDao<T> writeDao, TransactionService txService,
                     TransactionManager txManager, TransactionInMemoryCache memCache, Class<T> entityClass); Set<T> getByIds(List<String> ids); T getById(String id); T getSingle(QueryParameter... query); T getSingle(List<QueryParameter> query); Set<T> getAll(); List<T> getList(List<QueryParameter> query); OtherTemplate getOther(List<QueryParameter> query); List<OtherTemplate> getOtherList(List<QueryParameter> query); List<T> getList(QueryParameter... query); OtherTemplate getOther(QueryParameter... query); List<OtherTemplate> getOtherList(QueryParameter... query); void save(T... states); void update(T... states); void delete(T... states);  }
@Test public void testGetOtherListDelegation() { mockery.checking(new Expectations() { { exactly(1).of(readDao).getOtherList(with(equal(PARAM_LIST))); will(returnValue(Arrays.<QueryParameter[]>asList(PARAM_ARRAY, PARAM_ARRAY))); } }); Assert.assertEquals(Arrays.<QueryParameter[]>asList(PARAM_ARRAY, PARAM_ARRAY), this.services.readDao.<QueryParameter[]>getOtherList( PARAM_LIST)); mockery.assertIsSatisfied(); }
@Test public void testGetOtherListVarArgsListDelegation() { mockery.checking(new Expectations() { { exactly(1).of(readDao).getOtherList(with(equal(PARAM_ARRAY))); will(returnValue(Arrays.<List<QueryParameter>>asList(PARAM_LIST, PARAM_LIST))); } }); Assert.assertEquals(Arrays.<List<QueryParameter>>asList(PARAM_LIST, PARAM_LIST), this.services.readDao.<List<QueryParameter>>getOtherList(PARAM_ARRAY)); mockery.assertIsSatisfied(); }