Added convenience method for Java