@Transient public String getFamily() { StringBuilder builder = new StringBuilder(); builder.append(this.name); if (kittens != null) { for (Kitten kitten : kittens) { builder.append(", ").append(kitten.getName()); } } if (otherCat != null) { builder.append("\n\t").append(otherCat.getFamily()); } return builder.toString(); }
private void initAllKitten() throws InterruptedException { kitten1.start(); kitten2.start(); kitten1.join(); kitten2.join(); }