Ex-ATO chief testifies at his NSW trial