Add tests for complex generics APT issues

Related to #750