TriangleList2 { public String largestPerimeterWithSides() { double largest = 0; int indexOfLargest = 0; int index = 0; while (index < numberOfTriangles) { if (tList[indexOfLargest].perimeter() < tList[index].perimeter()) { indexOfLargest = index; } index++; } if (numberOfTriangles > 0) { return tList[indexOfLargest].perimeter() + " for sides " + tList[indexOfLargest].getS1() + ", " + tList[indexOfLargest].getS2() + ", " + tList[indexOfLargest].getS3(); } else { return "No triangles in list"; } } 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 largestPerimeterWithSidesTest() { 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); Assert.assertEquals("largestPerimeterWithSides Test", "13.0 for sides 3.0, 5.0, 5.0", tList.largestPerimeterWithSides()); TriangleList2 tList2 = new TriangleList2("Test List", null, 0); Assert.assertEquals("largestPerimeterWithSides Test", "No triangles in list", tList2.largestPerimeterWithSides()); }