/** * In this scenario we separate between functional parameters (starting with one underscore) * and data. Using this method functional parameters can be cascaded over multiple * levels. * * Will remove all parameters starting with underscore and not two underscore and * remove one underscore from thoos with more underscores. * * _test will be removed * __test will be _test * * after update * * @param in */ public static void updateFunctional(Map<String,Object> in) { in.keySet().removeIf(k -> isFunctional(k)); for (String key : new LinkedList<>(in.keySet())) if (key.startsWith("_")) in.put(key.substring(1), in.remove(key)); }