example on java usage