FunctionModel { public static FunctionModel forFunction(FunctionMetadata function, FunctionModelConfig config, Set<Class<?>> availableComponents, NodeDecorator... nodeDecorators) { NodeDecorator nodeDecorator = CompositeNodeDecorator.compose(nodeDecorators); FunctionModelNode node = FunctionModelNode.create(function.getDeclaringType(), config, availableComponents, nodeDecorator); return new FunctionModel(node, function); } private  FunctionModel(FunctionModelNode root, FunctionMetadata rootMetadata); InvokableFunction build(FunctionBuilder builder, ComponentMap components); FunctionModelNode getRoot(); boolean isValid(); String prettyPrint(); String prettyPrint(boolean showProxies); static FunctionModel forFunction(FunctionMetadata function,
                                          FunctionModelConfig config,
                                          Set<Class<?>> availableComponents,
                                          NodeDecorator... nodeDecorators); static FunctionModel forFunction(FunctionMetadata function,
                                          FunctionModelConfig config,
                                          Set<Class<?>> availableComponents,
                                          NodeDecorator nodeDecorator,
                                          ArgumentConverter argumentConverter); static FunctionModel forFunction(FunctionMetadata function, FunctionModelConfig config); static FunctionModel forFunction(FunctionMetadata function); static FunctionModel forFunction(FunctionMetadata function, FunctionModelNode functionNode); static T build(Class<T> functionType,
                            FunctionModelConfig config,
                            ComponentMap componentMap,
                            NodeDecorator... nodeDecorators); static T build(Class<T> functionType,
                            FunctionModelConfig config,
                            ComponentMap componentMap,
                            FunctionBuilder functionBuilder,
                            NodeDecorator... nodeDecorators); static T build(Class<T> functionType, FunctionModelConfig config); static T build(Class<T> functionType);  }
@Test(expectedExceptions = IllegalArgumentException.class) public void nodeAndMetadataMismatch() { FunctionMetadata metadata = EngineUtils.createMetadata(Fn.class, "foo"); FunctionModelConfig config = config(implementations(TestFn.class, BasicImpl.class)); FunctionModelNode node = FunctionModelNode.create(TestFn.class, config, Collections.<Class<?>>emptySet(), NodeDecorator.IDENTITY); FunctionModel.forFunction(metadata, node); }