[java] groups JDK root collection code for easier modification