Java example codes