I have short question because I can't understand my mistake.
I have a collections:
List<ManagedFilesAuthorityDTO> managedFilesAuthorityDTOs = filesAuthorityRepository.findAll().stream()
.map(ManagedFilesAuthorityDTO::new)
.collect(Collectors.toList());
then I'm creating new list
List<ManagedFilesAuthorityDTO> outputFileList = null;
and I would like to iterate for managedFilesAuthorityDTOs and assign some object to outputFileList.
Here's my loop:
for (ManagedFilesAuthorityDTO dto : managedFilesAuthorityDTOs) {
outputFileList.add(dto);
}
And I still getting NullPointerException because my outputFileList is equals null. What I am doing wrong that I can't create new List?