### Question:
SqlMapClientDaoAdapter implements MappingDao<Object>, Locator { @SuppressWarnings("unchecked") public Collection<Object> lookup(String id, Map<String, ?> parameters) { try { return sqlMapClient.queryForList(id, parameters); } catch (SQLException e) { throw new DaoException("Exception throw while executing query with statement id '" + id + "' and parameters '" + parameters + "'", e); } } SqlMapClientDaoAdapter(SqlMapClient sqlMapClient); Object update(String id, Object entity); Object insert(String id, Object entity); Object delete(String id, Object entity); @SuppressWarnings("unchecked") Collection<Object> lookup(String id, Map<String, ?> parameters); @SuppressWarnings("unchecked") Collection<Object> lookup(String id, Object ... parameters); SqlMapClient getSqlMapClient();  }### Answer:
@Test(groups = "unit") public void test_lookup_map_parameters() throws SQLException { List<?> listResult = Collections.emptyList(); stub(sqlMapClient.queryForList(anyString(), anyObject())).toReturn(listResult); Map<String, Object> params = new HashMap<String, Object>(); params.put("key1", "value1"); params.put("key2", "value2"); Collection<Object> result = adapter.lookup("name", params); assertSame(listResult, result); verify(sqlMapClient).queryForList(eq("name"), same(params)); }
@Test(groups = "unit") public void test_lookup_array_parameters() throws SQLException { List<?> listResult = Collections.emptyList(); stub(sqlMapClient.queryForList(anyString(), anyObject())).toReturn(listResult); Object[] params = new Object[2]; params[0] = "value1"; params[1] = "value2"; Collection<Object> result = adapter.lookup("name", params); assertSame(listResult, result); verify(sqlMapClient).queryForList(eq("name"), same(params)); }