@Test public void fromStrings() { assertThat(service.fromStrings(null), is(nullValue())); assertThat(service.fromStrings(allScopeStrings), equalTo(allScopes)); }
@Override public Set<SystemScope> fromStrings(Set<String> scope) { if (scope == null) { return null; } else { return new LinkedHashSet<SystemScope>(Collections2.filter(Collections2.transform(scope, stringToSystemScope), Predicates.notNull())); } }
DefaultSystemScopeService implements SystemScopeService { @Override public Set<SystemScope> fromStrings(Set<String> scope) { if (scope == null) { return null; } else { return new LinkedHashSet<SystemScope>(Collections2.filter(Collections2.transform(scope, stringToSystemScope), Predicates.notNull())); } } }
DefaultSystemScopeService implements SystemScopeService { @Override public Set<SystemScope> fromStrings(Set<String> scope) { if (scope == null) { return null; } else { return new LinkedHashSet<SystemScope>(Collections2.filter(Collections2.transform(scope, stringToSystemScope), Predicates.notNull())); } }  }
DefaultSystemScopeService implements SystemScopeService { @Override public Set<SystemScope> fromStrings(Set<String> scope) { if (scope == null) { return null; } else { return new LinkedHashSet<SystemScope>(Collections2.filter(Collections2.transform(scope, stringToSystemScope), Predicates.notNull())); } }  @Override Set<SystemScope> getAll(); @Override Set<SystemScope> getDefaults(); @Override Set<SystemScope> getDynReg(); @Override SystemScope getById(Long id); @Override SystemScope getByValue(String value); @Override void remove(SystemScope scope); @Override SystemScope save(SystemScope scope); @Override Set<SystemScope> fromStrings(Set<String> scope); @Override Set<String> toStrings(Set<SystemScope> scope); @Override boolean scopesMatch(Set<String> expected, Set<String> actual); @Override Set<String> removeRestrictedScopes(Set<String> scopes); }
DefaultSystemScopeService implements SystemScopeService { @Override public Set<SystemScope> fromStrings(Set<String> scope) { if (scope == null) { return null; } else { return new LinkedHashSet<SystemScope>(Collections2.filter(Collections2.transform(scope, stringToSystemScope), Predicates.notNull())); } }  @Override Set<SystemScope> getAll(); @Override Set<SystemScope> getDefaults(); @Override Set<SystemScope> getDynReg(); @Override SystemScope getById(Long id); @Override SystemScope getByValue(String value); @Override void remove(SystemScope scope); @Override SystemScope save(SystemScope scope); @Override Set<SystemScope> fromStrings(Set<String> scope); @Override Set<String> toStrings(Set<SystemScope> scope); @Override boolean scopesMatch(Set<String> expected, Set<String> actual); @Override Set<String> removeRestrictedScopes(Set<String> scopes);  }