### Question:
Modifier { public static Modifier[] convertFromQuery(@Nullable String query) throws InvalidModifierListException { if (query == null || "".equals(query)) { return EMPTY_LIST; } ArrayList<Modifier> ret = new ArrayList<>(); String[] queryComponents = query.split("[&;]"); for (String key : queryComponents) { String value = null; if (key.contains("=")) { value = key.substring(key.indexOf('=') + 1); key = key.substring(0, key.indexOf('=')); } switch (key) { case "tt": ret.add(transitionTarget()); break; case "all": ret.add(all()); break; case Splot.PARAM_DURATION: { double seconds = 0; if (value != null) { try { seconds = Double.valueOf(value); if (seconds <= 0) { seconds = 0; } ret.add(duration(seconds)); } catch (IllegalArgumentException x) { throw new InvalidModifierListException( "Bad duration \"" + value + "\"", x); } } } break; } } return ret.toArray(EMPTY_LIST); }  static String convertToQuery(Modifier ... modifiers); static Modifier[] convertFromQuery(@Nullable String query); static Duration duration(double seconds); static TransitionTarget transitionTarget(); static All all(); static final Modifier[] EMPTY_LIST; }### Answer:
@Test void convertFromQuery() { assertEquals( Arrays.asList( Modifier.duration(2), Modifier.transitionTarget(), Modifier.all()), Arrays.asList(Modifier.convertFromQuery("ins&d=2.00&tt&all"))); assertThrows(InvalidModifierListException.class, ()->Modifier.convertFromQuery("inc&d=-2&tt&all")); assertThrows(InvalidModifierListException.class, ()->Modifier.convertFromQuery("d=dog")); }