Refine test method generateKeyOwnedBy & generateKeyNotOwnedBy