Initial copy of java 5 code snippet