### Question:
CommonResource extends ServerResource { protected void verifyNotNullParameter(final Object parameter, final String parameterName) throws APIException { if (parameter == null) { throw new APIException("Parameter " + parameterName + " is mandatory."); } }  APISession getEngineSession(); HttpSession getHttpSession(); HttpServletRequest getHttpRequest(); Integer getIntegerParameter(final String parameterName, final boolean mandatory); Long getLongParameter(final String parameterName, final boolean mandatory); String getParameter(final String parameterName, final boolean mandatory); List<String> getParameterAsList(final String name); SearchOptions buildSearchOptions(); @Override String getAttribute(final String name); Long getPathParamAsLong(final String parameterName); List<Long> getParameterAsLongList(final String parameterName); String getPathParam(final String name);  }### Answer:
@Test(expected = APIException.class) public void nullMandatoryParameterIsForbidden() throws Exception { new CommonResource().verifyNotNullParameter(null, "unused"); }
@Test public void notNullMandatoryParameterIsForbidden() throws Exception { new CommonResource().verifyNotNullParameter(new Object(), "unused"); }