Ребят, у кого есть свободная минутка, пожалуйста помогите найти несоответствие условию.
package en.javarush.task.jdk13.task05.task0501;
/*
Cat carnage (1)
*/
public class Solution {
public static void main(String[] args) {
Cat catWhite = new Cat("Bob", 2, 3, 10);
Cat catBlack = new Cat("Tom", 1, 2, 7);
Cat catRed = new Cat("Musya", 4, 5, 21);
}
public static class Cat {
//write your code here
private String name;
private Integer age, weight, strength;
public Cat(String name, int age, int weight, int strength){
this.name = name;
this.age = age;
this.weight = weight;
this.strength = strength;
}
public boolean fight(Cat anotherCat) {
int resultAge;
int resultWeight;
int resultStrength;
if ((this.age - anotherCat.age) > 0) {
resultAge = 1;
}
else {
resultAge = -1;
}
if ((this.weight - anotherCat.weight) >0){
resultWeight = 1;
}
else {
resultWeight = -1;
}
if ((this.strength - anotherCat.strength) > 0){
resultStrength = 1;
}
else {
resultStrength = -1;
}
int winCat = resultAge + resultWeight + resultStrength;
if (winCat > 0) {
return true;
}
else return false;
}
}
}