Splitted examples and adapted to new Java API