Backport library to support Java 6