### Question:
NormalizationRestService extends RestServiceBase { @SuppressWarnings("unchecked") protected static List<Map<String, Object>> extractPreprocessors(Map<String, Object> normalizationDef, String normalizationName) { try { return (List<Map<String, Object>>) normalizationDef.get(CFG_PREPROCESSORS); } catch (ClassCastException e) { throw new SettingsException("Incorrect configuration of 'preprocessors' for normalization '" + normalizationName + "'."); } }  @SuppressWarnings("unchecked") @GET @Path("/") @Produces(MediaType.APPLICATION_JSON) Map<String, Object> availableNormalizations(); @GET @Path("/{normalizationName}/{id}") @Produces(MediaType.APPLICATION_JSON) Object normalizeOne(@PathParam("normalizationName") String normalizationName, @PathParam(INKEY_ID) String id); @GET @Path("/{normalizationName}") @Produces(MediaType.APPLICATION_JSON) Object normalizeBulk(@PathParam("normalizationName") String normalizationName, @Context UriInfo uriInfo); @SuppressWarnings("unchecked") List<StructuredContentPreprocessor> getPreprocessors(String normalizationName); Map<String, Object> runPreprocessors(List<StructuredContentPreprocessor> preprocessors, String id); static final String INKEY_ID; static final String CFG_PREPROCESSORS; static final String CFG_DESCRIPTION; static final String OUTKEY_WARNINGS; static final String OUTKEY_INPUT_ID; }### Answer:
@Test public void extractPreprocessors() { Map<String, Object> normalizationDef = null; try { NormalizationRestService.extractPreprocessors(normalizationDef, TEST_NORM_NAME); Assert.fail("NullPointerException expected"); } catch (NullPointerException e) { } normalizationDef = new HashMap<>(); Assert.assertNull(NormalizationRestService.extractPreprocessors(normalizationDef, TEST_NORM_NAME)); normalizationDef.put(NormalizationRestService.CFG_PREPROCESSORS, new Object()); try { NormalizationRestService.extractPreprocessors(normalizationDef, TEST_NORM_NAME); Assert.fail("SettingsException expected"); } catch (SettingsException e) { } List<Map<String, Object>> pl = new ArrayList<>(); normalizationDef.put(NormalizationRestService.CFG_PREPROCESSORS, pl); Assert.assertEquals(pl, NormalizationRestService.extractPreprocessors(normalizationDef, TEST_NORM_NAME)); }