Presuming that you are looking at mocking the setter setState(String s) in the class World below is the code uses doAnswer method to mock the setState.
Giả sử rằng bạn đang tìm kiếm tại mocking setState(String s) setter trong các lớp học trên thế giới dưới đây là các mã sử dụng doAnswer phương pháp thử setState.