java improvements, and an attemp of tests