import static org.junit.jupiter.api.Assertions.assertTrue; import java.lang.reflect.Method; import java.util.ArrayList; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; public class RhombusTest { ArrayList rhombusMethodList; @BeforeEach void getMethodList() { this.rhombusMethodList = new ArrayList<>(); Method[] methods = Rhombus.class.getDeclaredMethods(); for(Method method : methods) { this.rhombusMethodList.add(method.getName()); } } @Test void testCalcPerimter() { boolean hasCalcPerimeter = rhombusMethodList.contains("calcPerimeter"); assertTrue(hasCalcPerimeter); } @Test void testCalcArea() { boolean hasCalcArea = rhombusMethodList.contains("calcArea"); assertTrue(hasCalcArea); } }