NSW detective testifies at bomb plot trial