Question: given when then in java?
Answer: Given is the section that lays out the pre-conditions for the test, ie whatever state you're assuming the world to be in before you start. The When clause performs the action being tested. The Then statement checks that the post condition holds.