implement and test jid from pid