Задача не прошла тестирование: "Нить 4 из списка threads должна реализовать интерфейс Message." Что не так ? Уже перепробовал кучу способов, все работает но что хочет валидатор не пойму( П.С. скиньте рабочий код по этой задаче
package com.javarush.task.task16.task1632;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Solution {
public static List<Thread> threads = new ArrayList<>(5);
static {
threads.add(new Thread(new for1()));
threads.add(new Thread(new for2()));
threads.add(new Thread(() -> {
while(true) {
System.out.println("Ура");
try {
Thread.sleep(500);
} catch (InterruptedException e) {
}
}
}));
threads.add(new Thread(new for4()));
threads.add(new Thread(new for5()));
}
public static void main(String[] args) {
}
public static class for1 extends Thread{
private Thread current;
public void run(){
current= Thread.currentThread();
while(!current.isInterrupted()) {
}
}
}
public static class for2 extends Thread{
public void run(){
try{
Thread.sleep(1000000000);
}catch(InterruptedException e){
System.out.println("InterruptedException");
}
}
}
public static class for4 extends Thread implements Message{
private boolean repeat = true;
public void showWarning() { repeat = false; }
public void run() { while (repeat); }
}
public static class for5 extends Thread{
public void run(){
int sum=0;
String str="";
Scanner sc = new Scanner(System.in);
while(sc.hasNextLine()) {
str=sc.nextLine();
if(!str.equals("N"))
sum=sum+Integer.parseInt(str);
else {
System.out.println(sum);
sc.close();
return;
}
}
}
}
}