java preapproval example