Java example code