### Question:
ForgotPasswordMapper implements DataMapper<ForgotPassword, ForgotPasswordDto> { @Override public Collection<ForgotPasswordDto> mapEntitiesToDtos(Collection<ForgotPassword> input) { return input.stream() .map(this::mapEntityToDto) .collect(Collectors.toCollection(ArrayList::new)); }  @Override ForgotPassword mapDtoToEntity(ForgotPasswordDto input); @Override ForgotPasswordDto mapEntityToDto(ForgotPassword input); @Override Collection<ForgotPassword> mapDtosToEntities(Collection<ForgotPasswordDto> input); @Override Collection<ForgotPasswordDto> mapEntitiesToDtos(Collection<ForgotPassword> input);  }### Answer:
@Test public void mapEntitiesToDtos_expectAllMapped() { ForgotPassword forgotPassword1 = new ForgotPassword(); forgotPassword1.setEmail("test1@example.com"); ForgotPassword forgotPassword2 = new ForgotPassword(); forgotPassword2.setEmail("test2@example.com"); ArrayList<ForgotPassword> forgotPasswords = new ArrayList<>(2); forgotPasswords.add(forgotPassword1); forgotPasswords.add(forgotPassword2); ArrayList<ForgotPasswordDto> forgotPasswordDtos = (ArrayList<ForgotPasswordDto>) forgotPasswordMapper.mapEntitiesToDtos(forgotPasswords); assertThat(forgotPasswords, hasSize(2)); assertEquals(forgotPasswords.size(), forgotPasswordDtos.size()); for (int i = 0; i < forgotPasswords.size(); i++) { assertMapped(forgotPasswords.get(i), forgotPasswordDtos.get(i)); } }