@Test public void overwrite_Name() { String oldName = "THE NAME"; oldCourt.setName(oldName); String newName = oldName + " NEW"; newCourt.setName(newName); commonCourtOverwriter.overwrite(oldCourt, newCourt); assertEquals(newName, oldCourt.getName()); assertEquals(newName, newCourt.getName()); }
public void overwrite(CommonCourt oldCommonCourt, CommonCourt newCommonCourt) { oldCommonCourt.setName(newCommonCourt.getName()); oldCommonCourt.setType(newCommonCourt.getType()); overwriteDepartments(oldCommonCourt, newCommonCourt); }
CommonCourtOverwriter { public void overwrite(CommonCourt oldCommonCourt, CommonCourt newCommonCourt) { oldCommonCourt.setName(newCommonCourt.getName()); oldCommonCourt.setType(newCommonCourt.getType()); overwriteDepartments(oldCommonCourt, newCommonCourt); } }
CommonCourtOverwriter { public void overwrite(CommonCourt oldCommonCourt, CommonCourt newCommonCourt) { oldCommonCourt.setName(newCommonCourt.getName()); oldCommonCourt.setType(newCommonCourt.getType()); overwriteDepartments(oldCommonCourt, newCommonCourt); }  }
CommonCourtOverwriter { public void overwrite(CommonCourt oldCommonCourt, CommonCourt newCommonCourt) { oldCommonCourt.setName(newCommonCourt.getName()); oldCommonCourt.setType(newCommonCourt.getType()); overwriteDepartments(oldCommonCourt, newCommonCourt); }  void overwrite(CommonCourt oldCommonCourt, CommonCourt newCommonCourt); }
CommonCourtOverwriter { public void overwrite(CommonCourt oldCommonCourt, CommonCourt newCommonCourt) { oldCommonCourt.setName(newCommonCourt.getName()); oldCommonCourt.setType(newCommonCourt.getType()); overwriteDepartments(oldCommonCourt, newCommonCourt); }  void overwrite(CommonCourt oldCommonCourt, CommonCourt newCommonCourt);  }