### Question:
HqlQueryExecutor implements QueryExecutor, Initializable { protected void setNamedParameter(org.hibernate.query.Query<?> query, String name, Object value) { if (value instanceof Collection) { query.setParameterList(name, (Collection<?>) value); } else if (value.getClass().isArray()) { query.setParameterList(name, (Object[]) value); } else { query.setParameter(name, value); } }  @Override void initialize(); @Override List<T> execute(final Query query);  }### Answer:
@Test public void setNamedParameter() { org.hibernate.query.Query query = mock(org.hibernate.query.Query.class); String name = "abc"; Date value = new Date(); this.executor.setNamedParameter(query, name, value); verify(query).setParameter(name, value); }
@Test public void setNamedParameterList() { org.hibernate.query.Query query = mock(org.hibernate.query.Query.class); String name = "foo"; List<String> value = Arrays.asList("one", "two", "three"); this.executor.setNamedParameter(query, name, value); verify(query).setParameterList(name, value); }
@Test public void setNamedParameterArray() { org.hibernate.query.Query query = mock(org.hibernate.query.Query.class); String name = "bar"; Integer[] value = new Integer[] { 1, 2, 3 }; this.executor.setNamedParameter(query, name, value); verify(query).setParameterList(name, value); }