### Question:
QueryImpl extends Query implements Serializable, Message<QueryImpl> { public void addParameter(String key, String val) { Parameter p = new Parameter(key, val); this.parameters.add(p); this.paramLookup.put(p.getParameterName(), p); }  String getQueryLogicName(); UUID getId(); String getQueryName(); String getUserDN(); String getQuery(); String getQueryAuthorizations(); Date getExpirationDate(); int getPagesize(); int getPageTimeout(); long getMaxResultsOverride(); boolean isMaxResultsOverridden(); Set<Parameter> getParameters(); void setQueryLogicName(String name); void setId(UUID id); void setQueryName(String queryName); void setUserDN(String userDN); void setQuery(String query); void setQueryAuthorizations(String queryAuthorizations); void setExpirationDate(Date expirationDate); void setMaxResultsOverride(long maxResults); void setPagesize(int pagesize); void setPageTimeout(int pageTimeout); void setParameters(Set<Parameter> parameters); void addParameter(String key, String val); void addParameters(Map<String,String> parameters); void setParameters(Map<String,String> parameters); List<String> getDnList(); void setDnList(List<String> dnList); String getColumnVisibility(); void setColumnVisibility(String columnVisibility); Date getBeginDate(); void setBeginDate(Date beginDate); Date getEndDate(); void setEndDate(Date endDate); MultivaluedMap<String,String> getOptionalQueryParameters(); void setOptionalQueryParameters(MultivaluedMap<String,String> optionalQueryParameters); QueryImpl duplicate(String newQueryName); @Override int hashCode(); @Override String toString(); @Override boolean equals(Object o); Parameter findParameter(String parameter); QueryUncaughtExceptionHandler getUncaughtExceptionHandler(); void setUncaughtExceptionHandler(QueryUncaughtExceptionHandler uncaughtExceptionHandler); void initialize(String userDN, List<String> dnList, String queryLogicName, QueryParameters qp, MultivaluedMap<String,String> optionalQueryParameters); static String getOwner(String dn); void setOwner(String owner); String getOwner(); MultivaluedMap<String,String> toMap(); void populateMetric(BaseQueryMetric metric); @Override Map<String,String> getCardinalityFields(); @Override Schema<QueryImpl> cachedSchema(); @Override void removeParameter(String key); static final String PARAMETER_SEPARATOR; static final String PARAMETER_NAME_VALUE_SEPARATOR; }### Answer:
@Test public void testForNPEinAddParam() { try { q.addParameter(QUERY_SYNTAX, "LUCENE"); } catch (NullPointerException e) { Assert.fail(); } }