Java examples and testing