Use dedicated method to check whether a "List" is empty.

Reported by "sonarcloud.io".
diff --git a/commons-geometry-euclidean/src/main/java/org/apache/commons/geometry/euclidean/twod/Polyline.java b/commons-geometry-euclidean/src/main/java/org/apache/commons/geometry/euclidean/twod/Polyline.java
index 1722934..15d5c3a 100644
--- a/commons-geometry-euclidean/src/main/java/org/apache/commons/geometry/euclidean/twod/Polyline.java
+++ b/commons-geometry-euclidean/src/main/java/org/apache/commons/geometry/euclidean/twod/Polyline.java
@@ -814,7 +814,7 @@
          * @return the first item from the given list or null if it does not exist
          */
         private Segment getFirst(final List<Segment> list) {
-            if (list != null && list.size() > 0) {
+            if (list != null && !list.isEmpty()) {
                 return list.get(0);
             }
             return null;
@@ -826,7 +826,7 @@
          * @return the last item from the given list or null if it does not exist
          */
         private Segment getLast(final List<Segment> list) {
-            if (list != null && list.size() > 0) {
+            if (list != null && !list.isEmpty()) {
                 return list.get(list.size() - 1);
             }
             return null;
diff --git a/commons-geometry-spherical/src/main/java/org/apache/commons/geometry/spherical/twod/GreatArcPath.java b/commons-geometry-spherical/src/main/java/org/apache/commons/geometry/spherical/twod/GreatArcPath.java
index 87cbd3b..7178e6a 100644
--- a/commons-geometry-spherical/src/main/java/org/apache/commons/geometry/spherical/twod/GreatArcPath.java
+++ b/commons-geometry-spherical/src/main/java/org/apache/commons/geometry/spherical/twod/GreatArcPath.java
@@ -667,7 +667,7 @@
          * @return the first item from the given list or null if it does not exist
          */
         private GreatArc getFirst(final List<GreatArc> list) {
-            if (list != null && list.size() > 0) {
+            if (list != null && !list.isEmpty()) {
                 return list.get(0);
             }
             return null;
@@ -679,7 +679,7 @@
          * @return the last item from the given list or null if it does not exist
          */
         private GreatArc getLast(final List<GreatArc> list) {
-            if (list != null && list.size() > 0) {
+            if (list != null && !list.isEmpty()) {
                 return list.get(list.size() - 1);
             }
             return null;