Absolutely confused here - I'm even failing on conditions that are obviously met, such as "The program should display text on the screen."
Am I coming at this from the completely wrong angle?
package com.codegym.task.task08.task0819;
import java.util.HashSet;
import java.util.Set;
/*
Set of cats
*/
public class Solution {
public static void main(String[] args) {
Set<Cat> cats = createCats();
//write your code here. step 3
for(Cat cat : cats) {
if(cat.name.equals("Bess"))
cats.remove(cat);
}
printCats(cats);
}
public static Set<Cat> createCats() {
//write your code here. step 2
HashSet<Cat> cats = new HashSet<Cat>();
cats.add(new Cat("Alan"));
cats.add(new Cat("Bess"));
cats.add(new Cat("Charles"));
return cats;
}
public static void printCats(Set<Cat> cats) {
// step 4
for(Cat cat: cats) {
System.out.println(cat);
}
}
// step 1
public static class Cat {
String name;
Cat(String name) {
this.name = name;
}
}
}