DRY up tests using type generic methods