Triangle { public double area() { double ab = a.distanceTo(b); double ac = a.distanceTo(c); double bc = b.distanceTo(c); double result = 0; if(!isTriangle(ab,ac,bc)){ System.out.println("Error - not available create triangle"); } else { double perimetrS = (ab + bc + ac) /2; result = Math.sqrt(perimetrS * (perimetrS - ab) * (perimetrS - bc) * (perimetrS - ac)); } return result; } Triangle(Point a, Point b, Point c); double area(); void sayArea(); static void main(String[] args);  }
@Test public void whenIsTriangleIsItArea(){ Point a = new Point(1,1); Point b = new Point(1,1); Point c = new Point(5,11); Triangle triangle = new Triangle(a,b,c); double result = triangle.area(); double testresult = 0; Assert.assertThat(result,is(testresult)); }