} else if (null == targetBranchOffice) {
// Throw NPE
throw new NullPointerException("targetBranchOffice is null"); //NOI18N
+ } else if (Objects.equals(sourceBranchOffice, targetBranchOffice)) {
+ // Throw IAE
+ throw new IllegalArgumentException("sourceBranchOffice and targetBranchOffice are the same"); //NOI18N
}
// Copy all fields
targetBranchOffice.setBranchContactEmployee(sourceBranchOffice.getBranchContactEmployee());
targetBranchOffice.setBranchCountry(sourceBranchOffice.getBranchCountry());
targetBranchOffice.setBranchEmailAddress(sourceBranchOffice.getBranchEmailAddress());
- targetBranchOffice.setBranchEntryCreated(sourceBranchOffice.getBranchEntryCreated());
- targetBranchOffice.setBranchEntryUpdated(sourceBranchOffice.getBranchEntryUpdated());
targetBranchOffice.setBranchFaxNumber(sourceBranchOffice.getBranchFaxNumber());
targetBranchOffice.setBranchHouseNumber(sourceBranchOffice.getBranchHouseNumber());
targetBranchOffice.setBranchHouseNumberExtension(sourceBranchOffice.getBranchHouseNumberExtension());