ListObject.getDataRange() will only return the data rows.
To get the header row, use ListObject.getListColumns(). Add the following code in your method to print the list of header row.
for (int iColumn = 0 ; iColumn < table.getListColumns().getCount() ; iColumn++)
{
System.out.print(table.getListColumns().get(iColumn).getName());
}
System.out.println();
I work with Aspose as a Developer Evangelist.