add java code example