### Question:
RequestParameterSet { public final Boolean getAsBoolean(String parameterName) { return getAsBoolean(parameterName, null); } protected  RequestParameterSet(); String getOutputTimezone(); void setOutputTimezone(String timezone); boolean isGeneralize(); void setGeneralize(boolean generalize); @JsonProperty String getTimespan(); void setTimespan(String timespan); boolean isBase64(); void setBase64(boolean base64); boolean isExpanded(); void setExpanded(boolean expanded); String getLocale(); void setLocale(String locale); String getResultTime(); void setResultTime(String resultTime); Set<String> availableParameterNames(); final boolean containsParameter(String parameter); void removeParameter(String parameterName); final void setParameters(Map<String, JsonNode> parameters); final void setParameter(String parameter, Object value); final void setParameter(String parameterName, JsonNode value); final T getAs(Class<T> clazz,
                             String parameterName,
                             T defaultValue); final T getAs(Class<T> clazz, String parameterName); final JsonNode getParameterValue(String parameterName); final String[] getAsStringArray(String parameterName); final String[] getAsStringArray(String parameterName,
                                           String[] defaultValue); final String getAsString(String parameterName); final String getAsString(String parameterName, String defaultValue); final Integer getAsInt(String parameterName); final Integer getAsInt(String parameterName, Integer defaultValue); final Boolean getAsBoolean(String parameterName); final Boolean getAsBoolean(String parameterName, Boolean defaultValue); abstract String[] getDatasets(); IoParameters toParameters(); @Override String toString();  }### Answer:
@Test public void when_booleanParameterNotPresent_then_returnNullInsteadOfExceptions() { RequestParameterSet parameterset = createDummyParameterSet(); assertThat(parameterset.getAsBoolean("notthere"), nullValue(Boolean.class)); }
@Test public void when_booleanParameterNotPresent_then_returnDefault() { RequestParameterSet parameterset = createDummyParameterSet(); assertThat(parameterset.getAsBoolean("notthere", false), is(false)); }