/*[deutsch]
<p>Bestimmt die Differenz zwischen den angegebenen Quartalen. </p>

@param   q1  first quarter year
@param   q2  second quarter year
@return  difference in quarter years
171894
public static Quarters between(CalendarQuarter q1, CalendarQuarter q2) {

        PlainDate d1 = q1.atDayOfQuarter(1);
        PlainDate d2 = q2.atDayOfQuarter(1);
        return Quarters.between(d1, d2);

    }
817110
@Override
  public int compare(S solution1, S solution2) {
    int result = rankComparator.compare(solution1, solution2) ;
    if (result == 0) {
      result = NewcrowdingDistanceComparator.compare(solution1, solution2);
    }

    return result;
  }
66551
public static int RankCompare(Solution solution1, Solution solution2)
   {
      int rank1 = solution1.getRank();
      int rank2 = solution2.getRank();

      if (rank1 < rank2)
      {
         return -1;
      }
      else if (rank1 > rank2)
      {
         return 1;
      }
      else
      {
         return 0;
      }
   }
1101456
public static <E> Set<E> difference(Set<E> first, Set<E> second) {
        if (first == null || first.size() == 0) {
            return new HashSet<>();
        }

        if (second == null || second.size() == 0) {
            return first;
        }

        Set<E> difference = new HashSet<>(first);
        difference.removeAll(second);
        return difference;
    }
647906
public final void mul(Quaternion q1, Quaternion q2) {
		if (this != q1 && this != q2) {
			this.w = q1.w*q2.w - q1.x*q2.x - q1.y*q2.y - q1.z*q2.z;
			this.x = q1.w*q2.x + q2.w*q1.x + q1.y*q2.z - q1.z*q2.y;
			this.y = q1.w*q2.y + q2.w*q1.y - q1.x*q2.z + q1.z*q2.x;
			this.z = q1.w*q2.z + q2.w*q1.z + q1.x*q2.y - q1.y*q2.x;
		}
		else {
			double	x1, y1, w1;

			w1 = q1.w*q2.w - q1.x*q2.x - q1.y*q2.y - q1.z*q2.z;
			x1 = q1.w*q2.x + q2.w*q1.x + q1.y*q2.z - q1.z*q2.y;
			y1 = q1.w*q2.y + q2.w*q1.y - q1.x*q2.z + q1.z*q2.x;
			this.z = q1.w*q2.z + q2.w*q1.z + q1.x*q2.y - q1.y*q2.x;
			this.w = w1;
			this.x = x1;
			this.y = y1;
		}
	}
1303639
public static Years<Weekcycle> between(CalendarWeek w1, CalendarWeek w2) {

        int delta = w2.getYear() - w1.getYear();

        if (delta > 0) {
            if (w2.getWeek() < w1.getWeek()) {
                delta--;
            }
        } else if (delta < 0) {
            if (w2.getWeek() > w1.getWeek()) {
                delta++;
            }
        }

        return Years.ofWeekBased(delta);

    }
965865
public static boolean isGreater(BigDecimal bigNum1, BigDecimal bigNum2) {
		Assert.notNull(bigNum1);
		Assert.notNull(bigNum2);
		return bigNum1.compareTo(bigNum2) > 0;
	}
711533
public final void conjugate(Quaternion q1) {
		this.x = -q1.x;
		this.y = -q1.y;
		this.z = -q1.z;
		this.w = q1.w;
	}
792791
public V get(K1 key1, K2 key2) {
        return JMOptional.getOptional(nestedMap, key1).map(map -> map.get(key2))
                .orElse(null);
    }
470306
public static <T> int compare(T o1, T o2, Comparator<T> comparator) {
		if(o1 == null) {
			return o2 == null ? 0 : 1;
		} else if(o2 == null) {
			return -1;
		} else {
			return comparator.compare(o1, o2);
		}
	}
151766
def q(segmentation, s1, s2):
    
    index1 = find_index(segmentation, s1)
    index2 = find_index(segmentation, s2)
    return index1 == index2
958271
public DoublePoint Subtract(DoublePoint point1, DoublePoint point2) {
        DoublePoint result = new DoublePoint(point1);
        result.Subtract(point2);
        return result;
    }
319941
@SuppressWarnings("unchecked")
    final int compare(Object k1, Object k2) {
        return comparator==null ? ((Comparable<? super K>)k1).compareTo((K)k2)
            : comparator.compare((K)k1, (K)k2);
    }
546479
public CalendarQuarter minus(Years<CalendarUnit> years) {

        if (years.isEmpty()) {
            return this;
        }

        return CalendarQuarter.of(MathUtils.safeSubtract(this.year, years.getAmount()), this.quarter);

    }
1170773
public static <X extends Comparable<? super X>> int compare(X x1, X x2) {
		if (x1 == null) return x2 == null ? 0 : -1;
		return x2 == null ? 1 : x1.compareTo(x2);
	}
1303497
public static String subtractSeq(final String first, final String second) {
    return subtractSeq(first, second, DELIMITER);
  }
1361787
@Nonnull
  @ReturnsMutableCopy
  public Matrix getQ ()
  {
    final Matrix aNewMatrix = new Matrix (m_nRows, m_nCols);
    final double [] [] aNewArray = aNewMatrix.internalGetArray ();
    for (int k = m_nCols - 1; k >= 0; k--)
    {
      final double [] aQRk = m_aQR[k];
      for (int nRow = 0; nRow < m_nRows; nRow++)
        aNewArray[nRow][k] = 0.0;
      aNewArray[k][k] = 1.0;
      for (int j = k; j < m_nCols; j++)
      {
        if (aQRk[k] != 0)
        {
          double s = 0.0;
          for (int i = k; i < m_nRows; i++)
            s += m_aQR[i][k] * aNewArray[i][j];
          s = -s / aQRk[k];
          for (int i = k; i < m_nRows; i++)
          {
            aNewArray[i][j] += s * m_aQR[i][k];
          }
        }
      }
    }
    return aNewMatrix;
  }