Code cleanup
Fixed generic parameter import from method context + unit test.