### Question:
Scopes { public boolean weakMatch(Scopes other) { if (isNoneScope()) return false; if (isAnyScope()) return true; if (other == null || other.isNoneScope()) return true; if (other.isAnyScope()) return false; return !Collections.disjoint(scopes, other.scopes); } private  Scopes(String[] scopes, boolean escape); static Scopes from(String... scopes); boolean equals(Object obj); int hashCode(); boolean match(Scopes other); boolean weakMatch(Scopes other); String[] asStringArray(); boolean isNoneScope(); boolean isAnyScope(); boolean isDefaultScope(); String toString(); static final Scopes DEFAULT; static final Scopes NONE; static final Scopes ANY; }### Answer:
@Test public void testWeakMatch() throws Exception { Scopes scopes1 = Scopes.DEFAULT; Scopes scopes2 = Scopes.from("scope"); assert !scopes1.weakMatch(scopes2); assert !scopes2.weakMatch(scopes1); scopes1 = Scopes.from("scope1", "scope2"); scopes2 = Scopes.from("scope2"); assert scopes1.weakMatch(scopes2); assert scopes2.weakMatch(scopes1); scopes1 = Scopes.NONE; scopes2 = Scopes.from("scope2"); assert !scopes1.weakMatch(scopes2); assert scopes2.weakMatch(scopes1); scopes1 = Scopes.ANY; scopes2 = Scopes.from("scope2"); assert scopes1.match(scopes2); assert !scopes2.match(scopes1); }