JavaDoc, check for null/state

Signed-off-by: Alin Dreghiciu <adreghiciu@gmail.com>