I don't understand why If I return a new School, and the program runs, why the test didn't achieve the verification
package com.codegym.task.task14.task1403;
/*
Building and School
*/
import javax.swing.plaf.basic.BasicOptionPaneUI;
public class Solution {
public static void main(String[] args) {
Building school = getSchool();
Building shop = getBuilding();
System.out.println(school);
System.out.println(shop);
}
public static School getSchool() {
return new School();
}
public static Building getBuilding() {
return new Building();
}
static class School extends Building {
@Override
public String toString() {
return "School";
}
}
static class Building {
@Override
public String toString() {
return "Building";
}
}
}