function outtable = convert_table_to_java_table( intable )
%CONVERT_TABLE_TO_JAVA_TABLE Converts a given table to jTET's representation
%   This function converts a table from TET's internal representation to
%   jTET's representation, ready for use against any of jTET's tools.

    outputVar = ca.mcscert.jtet.expression.Variable('output', ca.mcscert.jtet.expression.RealType());
    outputVariables = java.util.Arrays.asList([outputVar]);
    vc = ca.mcscert.jtet.expression.VariableCollection(TET.getInstance.getVariableParser.parseVariables(intable.function_inputs), ca.mcscert.jtet.expression.PartialVariableCollection(outputVariables));
    outtable = ca.mcscert.jtet.tabularexpression.Table(intable.function_name, vc);

    TableBlock.convert_hierarchical_grid_to_java(intable.Grid2.cells, outtable.getLeftGrid().getSubHierarchy())

    outputGrid = ca.mcscert.jtet.tabularexpression.TwoDimensionalGrid();
    TableBlock.convert_twodimensional_grid_to_java(intable.Grid0, outputGrid);
    outtable.getVariableOutputs().put(outputVar, outputGrid);
end
