Не принимает валидатор по пунктам 3, 9,10. Что то с системой, так как данные я ввожу корректно, заведомо правильно как и все
package com.javarush.task.task20.task2028;
import java.util.*;
import java.io.*;
public class CustomTree extends AbstractList<String> implements Cloneable, Serializable{
@Override
public String get(int index){
throw new UnsupportedOperationException();
}
@Override
public int size(){
throw new UnsupportedOperationException();
}
@Override
public String set(int index, String element){
throw new UnsupportedOperationException();
}
@Override
public void add(int index, String element){
throw new UnsupportedOperationException();
}
@Override
public String remove(int index){
throw new UnsupportedOperationException();
}
@Override
public List<String> subList(int fromIndex, int toIndex){
throw new UnsupportedOperationException();
}
@Override
protected void removeRange(int fromIndex, int toIndex){
throw new UnsupportedOperationException();
}
@Override
public boolean addAll(int index, Collection<? extends String> c){
throw new UnsupportedOperationException();
}
static class Entry<String> implements Serializable{
String elementName;
boolean availableToAddLeftChildren;
boolean availableToAddRightChildren;
Entry<String> parent;
Entry<String> leftChild;
Entry<String> rightChild;
public Entry(String e){
this.availableToAddLeftChildren = true;
this.availableToAddRightChildren = true;
this.elementName = e;
}
// public void checkChildren(){
// if(leftChild.equals(null)) availableToAddLeftChildren = false;
// if(rightChild.equals(null)) availableToAddRightChildren = false;
// }
public boolean isAvailableToAddChildren() {
return availableToAddLeftChildren || availableToAddRightChildren;
}
}
}