### Question:
RegExHelper { public static boolean isValidPattern (@Nonnull @RegEx final String sRegEx) { try { Pattern.compile (sRegEx); return true; } catch (final PatternSyntaxException ex) { return false; } } private  RegExHelper(); @Nonnull static String [] getSplitToArray(@Nullable final CharSequence sText, @Nonnull @RegEx final String sRegEx); @Nonnull static String [] getSplitToArray(@Nullable final CharSequence sText,
                                           @Nonnull @RegEx final String sRegEx,
                                           @Nonnegative final int nLimit); @Nonnull static ICommonsList <String> getSplitToList(@Nullable final CharSequence sText, @Nonnull @RegEx final String sRegEx); @Nonnull static ICommonsList <String> getSplitToList(@Nullable final CharSequence sText,
                                                      @Nonnull @RegEx final String sRegEx,
                                                      @Nonnegative final int nLimit); @Nonnull static Matcher getMatcher(@Nonnull @RegEx final String sRegEx, @Nonnull final String sValue); @Nonnull static Matcher getMatcher(@Nonnull @RegEx final String sRegEx, @Nonnegative final int nOptions, @Nonnull final String sValue); static boolean stringMatchesPattern(@Nonnull @RegEx final String sRegEx, @Nonnull final String sValue); static boolean stringMatchesPattern(@Nonnull @RegEx final String sRegEx,
                                              @Nonnegative final int nOptions,
                                              @Nonnull final String sValue); @Nonnull static String stringReplacePattern(@Nonnull @RegEx final String sRegEx,
                                             @Nonnull final String sValue,
                                             @Nullable final String sReplacement); @Nonnull static String stringReplacePattern(@Nonnull @RegEx final String sRegEx,
                                             @Nonnegative final int nOptions,
                                             @Nonnull final String sValue,
                                             @Nullable final String sReplacement); @Nullable static String getAsIdentifier(@Nullable final String s); @Nullable static String getAsIdentifier(@Nullable final String s, final char cReplacement); @Nullable static String getAsIdentifier(@Nullable final String s, @Nonnull final String sReplacement); static boolean isValidPattern(@Nonnull @RegEx final String sRegEx); @Nullable static String [] getAllMatchingGroupValues(@Nonnull @RegEx final String sRegEx, @Nonnull final String sValue);  }### Answer:
@Test public void testIsValidPattern () { assertTrue (RegExHelper.isValidPattern ("")); assertTrue (RegExHelper.isValidPattern ("abc")); assertTrue (RegExHelper.isValidPattern ("ab.+c")); assertTrue (RegExHelper.isValidPattern ("^ab.+c")); assertTrue (RegExHelper.isValidPattern ("ab.+c$")); assertTrue (RegExHelper.isValidPattern ("^ab.+c$")); assertFalse (RegExHelper.isValidPattern ("*-[]")); try { RegExHelper.isValidPattern (null); fail (); } catch (final NullPointerException ex) {} }