Captivity can be used as a term meaning the keeping of either domesticated animals ( livestock , pets ) or wild animals . Captivity can be used as a generalizing term to describe the keeping of either domesticated animals ( livestock and pets ) or wild animals .