[java] some sorting stuff