package objektwerks;

import org.junit.jupiter.api.Test;

class Person {
    String name;
    Integer age;

    Person(String name, Integer age) {
        this.name = name;
        this.age = age;
    }
}

interface Behavior {
    String behavior();
}

abstract class Canine implements Behavior {
    String typeOf;

    abstract String bark();
}
 
class Dog extends Canine {
    Dog() {
        super.typeOf = getClass().getSimpleName();
    }
    
    String bark() {
        return "ruf ruf";
    }

    public String behavior() {
        return "friendly";
    }
}

class ClassTest {
    @Test void classTest() {
        var person = new Person("Fred Flintstone", 25);
        assert(person.name.equals("Fred Flintstone"));
        assert(person.age == 25);
    }

    @Test void inheritenceTest() {
        var dog = new Dog();
        assert(dog.bark().equals("ruf ruf"));
    }

    @Test void interfaceTest() {
        var dog = new Dog();
        assert(dog.behavior().equals("friendly"));
    }
}
@@ -57,21 +57,22 @@
 %0A%0Aclass 
-Perso
+Cavema
 n %7B%0A    
@@ -106,21 +106,22 @@
 e;%0A%0A    
-Perso
+Cavema
 n(String
@@ -628,21 +628,22 @@
 var 
-perso
+cavema
 n = new 
 Pers
@@ -642,13 +642,14 @@
 new 
-Perso
+Cavema
 n(%22F
@@ -685,21 +685,22 @@
  assert(
-perso
+cavema
 n.name.e
@@ -745,13 +745,14 @@
 ert(
-perso
+cavema
 n.ag

refactored class test Person to Caveman