Following a moving object with camera in Box2D (Processing)

Hi guys! I am making a game in which I have to make a camera like effect such that a moving object doesnt go outside the screen width.
In short I want a camera following effect like in "Angry Birds". I tried this link: http://www.emanueleferonato.com/2010/04/29/following-a-body-with-the-camera-in-box2d/
but cant get it to work. Can u help me how can i do that in Box2D (Processing)?
will someone help?
I think you need to define what you mean by "can't get it to work".
I mean i am unable to use this code in processing. My english is not that
help guys........

Original thread: https://box2d.org/forum/viewtopic.php?t=9909