Adding in the Java version.