FunctionConfig { public Function createFunction(Geoclient geoclient) { log.debug("Attempting to create function {}", this.id); WorkArea workAreaOne = this.workAreaOneConfig.createWorkArea(); WorkArea workAreaTwo = null; if (isTwoWorkAreaFunction()) { workAreaTwo = this.workAreaTwoConfig.createWorkArea(); warnIfDuplicateFieldIds(workAreaOne, workAreaTwo); } DefaultConfiguration funConf = this.configuration; if (funConf == null) { log.warn("Function.configuration is null. Defaulting to new instance."); funConf = new DefaultConfiguration(); } GeosupportFunction function = new GeosupportFunction(this.id, workAreaOne, workAreaTwo, geoclient, funConf); return function; } FunctionConfig(String id, WorkAreaConfig workAreaOneConfig, WorkAreaConfig workAreaTwoConfig,
        DefaultConfiguration configuration);  FunctionConfig(String id, WorkAreaConfig workAreaOneConfig, WorkAreaConfig workAreaTwoConfig); Function createFunction(Geoclient geoclient); boolean isTwoWorkAreaFunction(); boolean hasDefaultArguments(); String getId(); WorkAreaConfig getWorkAreaOneConfig(); WorkAreaConfig getWorkAreaTwoConfig(); Configuration getConfiguration(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj);  }
@Test public void testCreateTwoWorkAreaFunction_duplicateFields() { WorkAreaConfig duplicateFieldWa2 = new WorkAreaConfig("DUP", TestData.fieldDuplicateIdOfOne.getLength(), true, TestData.newFieldList(TestData.fieldDuplicateIdOfOne),Collections.<Filter>emptyList()); FunctionConfig badFun = new FunctionConfig("DUP", this.wa1Config, duplicateFieldWa2); badFun.createFunction(new GeoclientStub()); }