added Junit test to help fixing bug #7058