???????????void???????????????????????????????????????????void???????????? ?? void?????????з??????????????????????????
???????????????????????void???????????
??????????????????????void?????? ??????????????????????????????????Щvoid?????????????£?????????????????????
????1?? ????????????е???????????????????
????2????????????
????3?????????????????
????4???????????????????????????е?????????
????5??????????????
???????????void ??????????????????????????????????????????????????????????????????????????
??????η???void?????????????????????????????????????????????????? ???????????????????
??????????????????????

public class ServiceHolder {
private final Set<Object> services = new HashSet<Object>();
public void addService(Object service) {
services.add(service);
}
public void removeService(Object service) {
services.remove(service);
}
}
?????????????void  addService (..) ????????????????????????????? ??????services ?????????????????????е?? ??????????????????????services?????????????????
??????λ???????б?????  ??????mock??????????
@Test
public void testAddService() throws Exception {
ServiceHolder tested = new ServiceHolder();
final Object service = new Object();
tested.addService(service);
// ?????б?????????????
Set<String> services = Whitebox.getInternalState(tested??"services");
assertEquals("Size of the "services" Set should be 1"?? 1?? services.size());
assertSame("The services Set should didn't contain the expect service"??
service?? services.iterator().next());
}
????Whitebox.getInternalState(tested??"services");  ??powermocker????????????????????????????
????????????????г??????????void????????? ?????????????????????????????????????????????????
????????PowerMock??org.powermock.reflect.Whitebox ???????????????Щ??????