@Test
public void verifyOnlyNonExistingNoteArePersisted()
{

    // Given
    final List<Note> notes = rnd.randomObjects( Note.class, 3, "newNote" );
    final List<Note> existingNotes = rnd.randomObjects( Note.class, 2, "newNote" );
    event.setNotes( newArrayList( concat( notes, existingNotes ) ) );
    // When
    when( commentService.filterExistingNotes( anyList() ) )
        .thenReturn( notes.stream().map( Note::getNote ).collect( Collectors.toList() ) );
    this.hook.validateEvent( mock( ValidationErrorReporter.class ), event );
    // Then
    assertThat( event.getNotes(), hasSize( 3 ) );
}