Australia's longest criminal trial almost at an end