java reflection generic resolver