AsMethod asMethod = new AsMethod();
asMethod.setComment("(factory)");
asMethod.setMethodName("as" + template.classname);
asMethod.setReturnclass(template.classname);
Statement statement = new Statement();
statement.setInnerStatement(" return new " + behaviour.classname + "(state);");
asMethod.setStatement(statement);
asMethod.setParameters(new Parameters());
behaviour.addAsMethod(asMethod);
Imports imports = new Imports();