if (!CollectionUtils.isEmpty(projectsWithCommercialStopEnabled)) {
Study projectWithMaxCommercialStop = Collections.max(projectsWithCommercialStopEnabled,
Comparator.comparingInt(Study::getCommercialStopDate));
retrofitPlanVesselDto.setCommercialStopDate(projectWithMaxCommercialStop.getCommercialStopDate());
if(Boolean.TRUE.equals(vessel.hasDryDockDate())){
int dryDockYear = vessel.getVesselCharacteristic().getDryDockDate().getYear();
if (dryDockYear < projectWithMaxCommercialStop.getCommercialStopDate()) {
retrofitPlanVesselDto.setNextDryDockDate(null);
retrofitPlanVesselDto.setCommercialStopDate(projectWithMaxCommercialStop.getCommercialStopDate());
}
}
}