SystemNotificationServiceImpl implements SystemNotificationService { @Override public List<SystemNotificationDto> getReversed( List<SystemNotificationDto> original) { List<SystemNotificationDto> copy = new ArrayList<SystemNotificationDto>( original); Collections.reverse(copy); return copy; } SystemNotificationServiceImpl(PatientRepository patientRepository,
			SystemNotificationRepository systemNotificationRepository,
			ModelMapper modelMapper); @Override List<SystemNotificationDto> findAllSystemNotificationDtosByPatient(
			long patientId); @Override ArrayList<SystemNotificationDto> makeSystemNotificationDtos(); @Override List<SystemNotificationDto> getReversed(
			List<SystemNotificationDto> original);  }
@Test public void testGetReversed() { List<SystemNotificationDto> systemNotificationDtos = new ArrayList<SystemNotificationDto>(); List<SystemNotificationDto> systemNotificationDtosExpected = new ArrayList<SystemNotificationDto>(); SystemNotificationDto systemNotificationDto1 = mock(SystemNotificationDto.class); systemNotificationDtos.add(systemNotificationDto1); SystemNotificationDto systemNotificationDto2 = mock(SystemNotificationDto.class); systemNotificationDtos.add(systemNotificationDto2); SystemNotificationDto systemNotificationDto3 = mock(SystemNotificationDto.class); systemNotificationDtos.add(systemNotificationDto3); systemNotificationDtosExpected.add(systemNotificationDto3); systemNotificationDtosExpected.add(systemNotificationDto2); systemNotificationDtosExpected.add(systemNotificationDto1); List<SystemNotificationDto> SystemNotificationDtoReversed = snst .getReversed(systemNotificationDtos); Assert.assertEquals(systemNotificationDtosExpected, SystemNotificationDtoReversed); }