FlagsEnabled { public boolean isFlagEnabled(Object flag) { return flags.contains(flag); }  void add(Object flag); void remove(Object flag); boolean isFlagEnabled(Object flag); @Override String toString(); static FlagsEnabled forQueryOptions(final QueryOptions queryOptions); static boolean isFlagEnabled(QueryOptions queryOptions, Object flag);  }
@Test public void testFlagsEnabled() { QueryOptions queryOptions = queryOptions(enableFlags("a", "b")); assertTrue(isFlagEnabled(queryOptions, "a")); assertTrue(isFlagEnabled(queryOptions, "b")); assertFalse(isFlagEnabled(queryOptions, "c")); }