type templates need some work (java)