### Question:
InterfaceDaoInvoker implements DaoInvoker { public Object update(final Object obj) { if(dao == null) { throw new UnsupportedOperationException("The DAO '" + dao.getClass().getName() + "' doesn't implement the '" + Dao.class.getName() + "' interface and there for can't insert the entity."); } return dao.update(obj); } @SuppressWarnings("unchecked")  InterfaceDaoInvoker(final Object dao); Object insert(final Object obj); Object insert(String name, Object obj); Object update(final Object obj); Object update(String name, Object obj); Object delete(Object entity); Object delete(String name, Object entity); void flush(); Object lookupByQuery(final String query, final Object ... parameters); Object lookupByQuery(final String query, final Map<String, ?> parameters); Object lookup(final String name, final Object ... parameters); Object lookup(final String name, final Map<String, ?> parameters);  }### Answer:
@Test public void test_update() { DaoInvoker invoker = new InterfaceDaoInvoker(fullDao); Object toMerge = new Object(); invoker.update(toMerge); verify(fullDao).update(same(toMerge)); }
@Test public void test_update_named() { DaoInvoker invoker = new InterfaceDaoInvoker(fullDao); Object toMerge = new Object(); invoker.update("myMerge", toMerge); verify(fullDao).update(eq("myMerge") ,same(toMerge)); }