DefineFunctionUtils { static Map<String, MethodDeclaration> getDefineFunctionsMethodMap(final List<DefineFunction> defineFunctions) { Map<String, MethodDeclaration> toReturn = new HashMap<>(); defineFunctions.forEach(defineFunction -> toReturn.put(defineFunction.getName(), getDefineFunctionMethodDeclaration(defineFunction))); return toReturn; } private  DefineFunctionUtils();   }
@Test(expected = KiePMMLException.class) public void getDefineFunctionsMethodMapUnsupportedExpression() { List<DefineFunction> defineFunctions = unsupportedExpressionSupplier.stream().map(defineFunctionCreator).collect(Collectors.toList()); DefineFunctionUtils.getDefineFunctionsMethodMap(defineFunctions); }
@Test public void getDefineFunctionsMethodMapSupportedExpression() { List<DefineFunction> defineFunctions = supportedExpressionSupplier.stream().map(defineFunctionCreator).collect(Collectors.toList()); Map<String, MethodDeclaration> retrieved = DefineFunctionUtils.getDefineFunctionsMethodMap(defineFunctions); assertEquals(defineFunctions.size(), retrieved.size()); }