TriangleCalc { public double maxSide() { double result = 0; double ab = a.distanceTo(b); double ac = a.distanceTo(c); double bc = b.distanceTo(c); if(!isTriangle(ab,ac,bc)){ System.out.println("Error - not available create triangle"); } else { result = max(ab, ac); result = max(result,bc); } return result; } TriangleCalc(Point a, Point b, Point c); double maxSide(); void sayMaxSide(); static void main(String[] args);  }
@Test public void whenIsTriangleItHaveMaxSide(){ Point a = new Point(1,1); Point b = new Point(2,1); Point c = new Point(5,11); TriangleCalc triangle = new TriangleCalc(a,b,c); double result = new BigDecimal(triangle.maxSide()).setScale(2, RoundingMode.UP).doubleValue();; double testresult = 10.78; Assert.assertThat(result,is(testresult)); }