samples on java 1.7 and higher