### Question:
MediaQueryTools { @Nullable public static ICommonsList <CSSMediaQuery> parseToMediaQuery (@Nullable final String sMediaQuery, @Nonnull final ECSSVersion eVersion) { if (StringHelper.hasNoText (sMediaQuery)) return null; final String sCSS = "@media " + sMediaQuery + " {}"; final CascadingStyleSheet aCSS = CSSReader.readFromString (sCSS, eVersion); if (aCSS == null) return null; final CSSMediaRule aMediaRule = aCSS.getAllMediaRules ().get (0); return aMediaRule.getAllMediaQueries (); } private  MediaQueryTools(); @Nullable static ICommonsList <CSSMediaQuery> parseToMediaQuery(@Nullable final String sMediaQuery, @Nonnull final ECSSVersion eVersion); static boolean canWrapInMediaQuery(@Nullable final CascadingStyleSheet aCSS, final boolean bAllowNestedMediaQueries); @Nullable static CascadingStyleSheet getWrappedInMediaQuery(@Nonnull final CascadingStyleSheet aCSS,
                                                            @Nonnull final CSSMediaQuery aMediaQuery,
                                                            final boolean bAllowNestedMediaQueries); @Nullable static CascadingStyleSheet getWrappedInMediaQuery(@Nonnull final CascadingStyleSheet aCSS,
                                                            @Nonnull @Nonempty final Iterable <? extends CSSMediaQuery> aMediaQueries,
                                                            final boolean bAllowNestedMediaQueries);  }### Answer:
@Test public void testParseMediaQuery () { List <CSSMediaQuery> aMQs = MediaQueryTools.parseToMediaQuery ("screen", s_eVersion); assertNotNull (aMQs); assertEquals (1, aMQs.size ()); aMQs = MediaQueryTools.parseToMediaQuery ("screen and (color)", s_eVersion); assertNotNull (aMQs); assertEquals (1, aMQs.size ()); aMQs = MediaQueryTools.parseToMediaQuery ("not screen and (color)", s_eVersion); assertNotNull (aMQs); assertEquals (1, aMQs.size ()); aMQs = MediaQueryTools.parseToMediaQuery ("only screen and (color)", s_eVersion); assertNotNull (aMQs); assertEquals (1, aMQs.size ()); aMQs = MediaQueryTools.parseToMediaQuery ("screen and (color), projection and (color)", s_eVersion); assertNotNull (aMQs); assertEquals (2, aMQs.size ()); aMQs = MediaQueryTools.parseToMediaQuery ("aural and (device-aspect-ratio: 16/9)", s_eVersion); assertNotNull (aMQs); assertEquals (1, aMQs.size ()); aMQs = MediaQueryTools.parseToMediaQuery ("speech and (min-device-width: 800px)", s_eVersion); assertNotNull (aMQs); assertEquals (1, aMQs.size ()); aMQs = MediaQueryTools.parseToMediaQuery ("screen and (max-weight: 3kg) and (color), (color)", s_eVersion); assertNotNull (aMQs); assertEquals (2, aMQs.size ()); aMQs = MediaQueryTools.parseToMediaQuery ("print and (min-width: 25cm)", s_eVersion); assertNotNull (aMQs); assertEquals (1, aMQs.size ()); }