HistoneView extends AbstractUrlBasedView { protected Map<String, Object> filterHistoneParams(Map<String, Object> paramMap) { return paramMap.entrySet().stream() .filter(entry -> entry.getValue() == null || entry.getValue().equals(ObjectUtils.NULL) || entry.getValue() instanceof Boolean || entry.getValue() instanceof Integer || entry.getValue() instanceof Float || entry.getValue() instanceof Double || entry.getValue() instanceof Long || entry.getValue() instanceof String || entry.getValue() instanceof Map || entry.getValue() instanceof HistoneRegex || entry.getValue() instanceof HistoneMacro || entry.getValue() instanceof EvalNode) .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); }  String getTemplateLocation(); void setTemplateLocation(String templateLocation); String getEncoding(); void setEncoding(String encoding); HistoneSpringEngine getHistone(); void setHistone(HistoneSpringEngine histone); List<HistoneTemplatePostProcessor> getHistoneTemplatePostProcessors(); void setHistoneTemplatePostProcessors(List<HistoneTemplatePostProcessor> histoneTemplatePostProcessors); HistoneProcessingExceptionProcessor getHistoneProcessingExceptionProcessor(); void setHistoneProcessingExceptionProcessor(HistoneProcessingExceptionProcessor histoneProcessingExceptionProcessor);  }
@Test public void testFilterHistoneParams() throws Exception { HistoneView templateView = new HistoneView(); Map<String, Object> parameterMap = new HashMap<>(); parameterMap.put("Integer", 1); parameterMap.put("String", "Param"); parameterMap.put("Boolean", Boolean.TRUE); parameterMap.put("Double", 1.2D); parameterMap.put("Long", 1L); parameterMap.put("Float", 1.3F); parameterMap.put("Map", new HashMap<>()); parameterMap.put("HistoneRegex", new HistoneRegex(false, false, false, Pattern.compile(""))); parameterMap.put("HistoneMacro", new HistoneMacro(new NullEvalNode())); parameterMap.put("EvalNode", new NullEvalNode()); parameterMap.put("NotSupportedArg", new ArrayList<>()); parameterMap = templateView.filterHistoneParams(parameterMap); assertNull(parameterMap.get("NotSupportedArg")); assertThat(parameterMap.size(), is(10)); }