import java.util.List;

class FstGenerator {

    private StringBuffer strBuff;
    private List<State> fstStates;

    public FstGenerator(List<State> fstStates) {
        this.fstStates = fstStates;
        this.strBuff = new StringBuffer();
    }

    public StringBuffer compute() {
        append("class HelloWorld {");
         
        generateMain();

        append("}");

        return strBuff;
    }

    private void append(String strToAppend) {
        strBuff.append(strToAppend);
        strBuff.append("\n");
    }

    private void generateMain() {
        appendWithTab("public void main(String... args) {", 1);

        appendWithTab("System.out.println(\"Hello World !\");", 2);

        appendWithTab("}", 1);
    }

    private void appendWithTab(String strToAppend, int numberOfTab) {
        for (int i = 0; i < numberOfTab; i++) {
            strBuff.append("\t");
        }
        strBuff.append(strToAppend);
        strBuff.append("\n");
    }

}

@@ -306,18 +306,18 @@
 ass 
-HelloWorld
+FstCompute
  %7B%22)
@@ -326,16 +326,28 @@
         
+emptyLine();
  %0A      
@@ -368,54 +368,232 @@
 ();%0A
-%0A        append(%22%7D%22);%0A%0A        return strBuff;
+        emptyLine();%0A%0A        for ( State state : fstStates ) %7B%0A            generateStateCase(state);%0A        %7D%0A%0A        append(%22%7D%22);%0A%0A        return strBuff;%0A    %7D%0A%0A    private void generateStateCase(State state) %7B%0A        
 %0A   
@@ -784,32 +784,38 @@
 lic 
-void main(String... args
+static int compute(int%5B%5D token
 ) %7B%22
@@ -848,44 +848,33 @@
 ab(%22
-System.out.println(%5C%22Hello World !%5C%22
+return node_0(token, 0, 0
 );%22,
@@ -1153,10 +1153,78 @@
 %0A    %7D%0A%0A
+    private void emptyLine() %7B%0A        strBuff.append(%22%5Cn%22);%0A    %7D%0A%0A
 %7D%0A

Rename generated class and filled main method