Suddenly, while al other checkmarks are green, the remove part no longer verifies for me, help?
package com.codegym.task.task17.task1703;
import java.util.ArrayList;
import java.util.List;
/*
Synchronized notes
*/
public class Solution {
public static void main(String[] args) {
}
public static class Note {
public final List<String> notes = new ArrayList<>();
public void addNote(int index, String note) {
synchronized (notes){
notes.add(index, note);}
System.out.println("A note [" + note + "] will now be added at position " + index);
System.out.println("The note [" + note + "] has already been added");
}
public void removeNote(int index) {
synchronized (notes){
String note = notes.remove(index);}
notes.remove(index);
System.out.println("A note will now be deleted from position " + index);
System.out.println("The note [" + notes.remove(index) + "] has already been deleted from position " + index);
}
}
}