Class Test {
private A a;
private B b;
}
Class B{
private final Map<String, Integer> sampleMap = new HashMap();
public Map<String, Integer> getSampleMap() {
return Collections.unmodifiableMap(this.sampleMap);
}
}如何通过模拟unModifiable getSampleMap模拟测试对象。我需要创建和设置键/值对。
https://stackoverflow.com/questions/51372434
复制相似问题