tested for JDK 6.