Extended imports for package name query in Java templates

Change-Id: I732a8cf8ca669cf00945b042841243c38073ca27