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 FstCompute {");
        emptyLine(); 
        generateMain();
        emptyLine();

        for ( State state : fstStates ) {
            generateStateCase(state);
        }

        append("}");

        return strBuff;
    }

    private void generateStateCase(State state) {
        
    }

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

    private void generateMain() {
        appendWithTab("public static int compute(int[] token) {", 1);

        appendWithTab("return node_0(token, 0, 0);", 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");
    }

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

}

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");
    }

}

--- 
+++ 
@@ -11,13 +11,22 @@
     }
 
     public StringBuffer compute() {
-        append("class HelloWorld {");
-         
+        append("class FstCompute {");
+        emptyLine(); 
         generateMain();
+        emptyLine();
+
+        for ( State state : fstStates ) {
+            generateStateCase(state);
+        }
 
         append("}");
 
         return strBuff;
+    }
+
+    private void generateStateCase(State state) {
+        
     }
 
     private void append(String strToAppend) {
@@ -26,9 +35,9 @@
     }
 
     private void generateMain() {
-        appendWithTab("public void main(String... args) {", 1);
+        appendWithTab("public static int compute(int[] token) {", 1);
 
-        appendWithTab("System.out.println(\"Hello World !\");", 2);
+        appendWithTab("return node_0(token, 0, 0);", 2);
 
         appendWithTab("}", 1);
     }
@@ -41,4 +50,8 @@
         strBuff.append("\n");
     }
 
+    private void emptyLine() {
+        strBuff.append("\n");
+    }
+
 }
MINOR: Rename generated class and filled main method
