### Question:
PgUtil { public static boolean isClockwise(List<Point> geoPolygon) { final Point p1 = geoPolygon.get(geoPolygon.size() - 2); final Point p2 = geoPolygon.get(0); final Point p3 = geoPolygon.get(1); final double[] a = toXYZ(p1); final double[] b = toXYZ(p2); final double[] c = toXYZ(p3); final double[] d = new double[]{a[0] - b[0], a[1] - b[1], a[2] - b[2]}; final double[] e = new double[]{c[0] - b[0], c[1] - b[1], c[2] - b[2]}; final double[] f = new double[]{ d[1] * e[2] - d[2] * e[1], d[2] * e[0] - d[0] * e[2], d[0] * e[1] - d[1] * e[0] }; final double s = f[0] * b[0] + f[1] * b[1] + f[2] * b[2]; return s > 0; } private  PgUtil(); static boolean isClockwise(List<Point> geoPolygon);  }### Answer:
@Test public void testOrientationOfCounterclockwiseGeoBoundary() { final List<Point> geoBoundary = createCounterclockwiseGeoBoundary(); assertFalse(PgUtil.isClockwise(geoBoundary)); }
@Test public void testOrientationOfClockwiseGeoBoundary() { final List<Point> geoBoundary = createCounterclockwiseGeoBoundary(); Collections.reverse(geoBoundary); assertTrue(PgUtil.isClockwise(geoBoundary)); }