### Question:
CompareHelper { public static int compare (final byte n1, final byte n2) { return Byte.compare (n1, n2); } private  CompareHelper(); static int compareTrueBeforeFalse(final boolean b1, final boolean b2); static int compareFalseBeforeTrue(final boolean b1, final boolean b2); static int compare(final byte n1, final byte n2); static int compare(final char n1, final char n2); static int compare(final double d1, final double d2); static int compare(final float f1, final float f2); static int compare(final int n1, final int n2); static int compare(final long n1, final long n2); static int compare(final short n1, final short n2); static int compare(@Nullable final DATATYPE aObj1,
                                                                              @Nullable final DATATYPE aObj2); static int compare(@Nullable final DATATYPE aObj1,
                                                                              @Nullable final DATATYPE aObj2,
                                                                              final boolean bNullValuesComeFirst); static int compare(@Nullable final DATATYPE aObj1,
                                        @Nullable final DATATYPE aObj2,
                                        @Nonnull final Comparator <? super DATATYPE> aComp); static int compare(@Nullable final DATATYPE aObj1,
                                        @Nullable final DATATYPE aObj2,
                                        @Nonnull final Comparator <? super DATATYPE> aComp,
                                        final boolean bNullValuesComeFirst); static int compare(@Nullable final String sStr1, @Nullable final String sStr2, @Nonnull final Locale aSortLocale); static int compare(@Nullable final String sStr1,
                             @Nullable final String sStr2,
                             @Nonnull final Locale aSortLocale,
                             final boolean bNullValuesComeFirst); static int compare(@Nullable final String sStr1, @Nullable final String sStr2, @Nonnull final Collator aCollator); @SuppressFBWarnings ({ "ES_COMPARING_PARAMETER_STRING_WITH_EQ" }) static int compare(@Nullable final String sStr1,
                             @Nullable final String sStr2,
                             @Nonnull final Collator aCollator,
                             final boolean bNullValuesComeFirst); static int compareIgnoreCase(@Nullable final String sStr1, @Nullable final String sStr2); @SuppressFBWarnings ({ "ES_COMPARING_PARAMETER_STRING_WITH_EQ" }) static int compareIgnoreCase(@Nullable final String sStr1, @Nullable final String sStr2, final boolean bNullValuesComeFirst); static final boolean DEFAULT_NULL_VALUES_COME_FIRST; }### Answer:
@Test public void testNullSafeCompare () { final String s1 = "A"; final String s2 = "B"; assertEquals (-1, CompareHelper.compare (s1, s2)); assertEquals (+1, CompareHelper.compare (s2, s1)); assertEquals (0, CompareHelper.compare (s1, s1)); assertEquals (0, CompareHelper.compare (s2, s2)); assertEquals (+1, CompareHelper.compare (s1, null)); assertEquals (+1, CompareHelper.compare (s2, null)); assertEquals (-1, CompareHelper.compare (null, s1)); assertEquals (-1, CompareHelper.compare (null, s2)); assertEquals (0, CompareHelper.compare ((String) null, null)); assertEquals (-1, CompareHelper.compare ("1.1 a", "1.1.1 a", L_DE)); assertEquals (-1, CompareHelper.compare ("1.1 a", "1.1.1 a", CollatorHelper.getCollatorSpaceBeforeDot (L_DE))); assertEquals (+1, CompareHelper.compare ("1.1 a", "1.1.1 a", Collator.getInstance (L_DE))); assertEquals (-1, CompareHelper.compare (L_DE, L_EN, Comparator.comparing (Locale::toString))); assertEquals (+1, CompareHelper.compare (L_DE, null, Comparator.comparing (Locale::toString))); assertEquals (-1, CompareHelper.compare (null, L_EN, Comparator.comparing (Locale::toString))); }