Fix bug in junit test