removed redundant makeSound sound method of abstract class Animal (#668)
* made changes to java reflection * removed redundant method makeSound in Animal abstract class
This commit is contained in:
parent
fc1bb6b7b1
commit
15dd97b485
|
@ -18,10 +18,6 @@ public abstract class Animal implements Eating {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String makeSound() {
|
|
||||||
return getSound();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected abstract String getSound();
|
protected abstract String getSound();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,7 +124,7 @@ public class ReflectionTest {
|
||||||
|
|
||||||
assertEquals(4, actualMethods.size());
|
assertEquals(4, actualMethods.size());
|
||||||
assertTrue(actualMethods.containsAll(Arrays.asList("getName",
|
assertTrue(actualMethods.containsAll(Arrays.asList("getName",
|
||||||
"setName", "getSound", "makeSound")));
|
"setName", "getSound")));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Reference in New Issue