Не проходит, при проверке объекты со списками равны, объекты без списков равны public class Solution { public static void main(String[] args) { //исправьте outputStream/inputStream в соответствии с путем к вашему реальному файлу try { String file = "C:\\Users\\ira\\Desktop\\write1.txt"; BufferedWriter writer = new BufferedWriter(new FileWriter(file)); BufferedReader reader = new BufferedReader(new FileReader(file)); Human ivanov = new Human("Ivanov"); ivanov.save(writer); writer.flush(); Human somePerson = new Human(); somePerson.load(reader); reader.close(); //check here that ivanov equals to somePerson - проверьте тут, что ivanov и somePerson равны if (ivanov.equals(somePerson)) { System.out.println("yeah"); } else System.out.println("nope"); } catch (IOException e) { e.printStackTrace(); System.out.println("Oops, something wrong with my file"); } catch (Exception e) { e.printStackTrace(); System.out.println("Oops, something wrong with save/load method"); } } public static class Human { public String name; public List<Asset> assets = new ArrayList<>(); public Human() { } public Human(String name, Asset... assets) { this.name = name; if (assets != null) { this.assets.addAll(Arrays.asList(assets)); } } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Human human = (Human) o; if (name != null ? !name.equals(human.name) : human.name != null) return false; return assets != null ? assets.equals(human.assets) : human.assets == null; } @Override public int hashCode() { int result = name != null ? name.hashCode() : 0; result = 31 * result + (assets != null ? assets.hashCode() : 0); return result; } public void save(BufferedWriter writer) throws Exception { //implement this method - реализуйте этот метод writer.write(this.name + "\n"); //имя есть по умолчанию, пишем сразу if (this.assets != null) { // если есть списки for (Asset a: this.assets // пишем их в цикле, каждое значение с новой строки ) { writer.write(a.getName() + "\n"); double priceDouble = a.getPrice(); writer.write(priceDouble + "\n"); //пишем как строки } } } public void load(BufferedReader reader) throws Exception { this.name = reader.readLine(); // имя есть по умолчанию, читаем первую строку if (reader.ready()) { // если после первой строки(имени) ридер готов читать дальше, //значит там что-то есть, читаем в цикле, пока есть что, пишем в лист ArrayList<String> data = new ArrayList<>(); while (reader.ready()) { data.add(reader.readLine()); // в этот лист вот здесь } for (int i = 0; i < data.size() - 1; i++) { String assetName = data.get(i); double assetValue = Double.parseDouble(data.get(i + 1)); Asset asset = new Asset(assetName, assetValue); this.assets.add(asset); //тут списки, парсим, пишем, добавляем i++; // считываем из листа через 1, нечет имя, чет значение } } } } } //после запуска в консоль выводит что объекты равны....