TriangleList2 { public boolean deleteTriangle(double s1In, double s2In, double s3In) { boolean result = false; int index = -1; Triangle t = new Triangle(s1In, s2In, s3In); for (int i = 0; i < numberOfTriangles; i++) { if (tList[i].equals(t)) { for (int j = i; j < numberOfTriangles - 1; j++) { tList[j] = tList[j + 1]; } tList[numberOfTriangles - 1] = null; numberOfTriangles--; result = true; break; } } return result; } TriangleList2(String listNameIn, Triangle[] tListIn, 
                        int numberOfTrianglesIn); String getListName(); Triangle[] getList(); int numTriangles(); double totalOfPerimeters(); double totalOfPerimeters2(); double smallestPerimeter(); double largestPerimeter(); String largestPerimeterWithSides(); String toString(); String summary(); TriangleList2 readFile(String fileNameIn); void addTriangle(double s1In, double s2In, double s3In); boolean deleteTriangle(double s1In, double s2In, double s3In);  }
@Test public void deleteTriangleTest() { Triangle[] tArray = new Triangle[20]; tArray[0] = new Triangle(3, 4, 5); tArray[1] = new Triangle(3, 5, 5); tArray[2] = new Triangle(3, 3, 3); TriangleList2 tList = new TriangleList2("Test List", tArray, 3); Triangle t = new Triangle(3, 5, 5); Triangle[] tA = tList.getList(); Assert.assertEquals("pre deleteTriangle Test", t, tA[1]); Assert.assertTrue("deleteTriangle true Test", tList.deleteTriangle(3, 4, 5)); Assert.assertEquals("deleteTriangle true Test", t, tA[0]); Assert.assertFalse("deleteTriangle false Test", tList.deleteTriangle(9, 9, 9)); }