refine test method generateKeyOwnedBy & generateKeyNotOwnedBy
check member count
Merge pull request #4151 from ahmetmircik/improvement/3.4/testMethodRefinement

Refine test method generateKeyOwnedBy & generateKeyNotOwnedBy