Incomplete Java solution