class {class_name} {{

    private int[] lChilds;
    private int[] rChilds;
    private double[] thresholds;
    private int[] indices;
    private int[][] classes;

    public {class_name}(int[] lChilds, int[] rChilds, double[] thresholds, int[] indices, int[][] classes) {{
        this.lChilds = lChilds;
        this.rChilds = rChilds;
        this.thresholds = thresholds;
        this.indices = indices;
        this.classes = classes;
    }}

    public int {method_name}(double[] features) {{
        return this.{method_name}(features, 0);
    }}

    public int {method_name}(double[] features, int node) {{
        if (this.thresholds[node] != -2) {{
            if (features[this.indices[node]] <= this.thresholds[node]) {{
                return {method_name}(features, this.lChilds[node]);
            }} else {{
                return {method_name}(features, this.rChilds[node]);
            }}
        }}
        return findMax(this.classes[node]);
    }}

    private int findMax(int[] nums) {{
        int index = 0;
        for (int i = 0; i < nums.length; i++) {{
            index = nums[i] > nums[index] ? i : index;
        }}
        return index;
    }}

    public static void main(String[] args) {{
        if (args.length == {n_features}) {{

            // Features:
            double[] features = new double[args.length];
            for (int i = 0, l = args.length; i < l; i++) {{
                features[i] = Double.parseDouble(args[i]);
            }}

            // Parameters:
            {left_childs}
            {right_childs}
            {thresholds}
            {indices}
            {classes}

            // Prediction:
            {class_name} clf = new {class_name}(lChilds, rChilds, thresholds, indices, classes);
            int estimation = clf.{method_name}(features);
            System.out.println(estimation);

        }}
    }}
}}