More changes to the Java part. Next: map construction