I was under the impression that selenium gave you this stuff for free. Does this help?
http://stackoverflow.com/questions/20903231/selenium-wait-until-element-is-present
http://selenium.googlecode.com/git/docs/api/java/org/openqa/selenium/support/ui/ExpectedConditions.html