@Test
public void testScopeFinderByName() throws Exception {

	String applicationName2 = "com.liferay.test2";
	ScopeFinder application1ScopeFinder = () -> scopesSet1;
	ScopeFinder application2ScopeFinder = () -> scopedSet2;
	Builder builder = new Builder();
	ScopeLocatorImpl scopeLocatorImpl = builder.withScopeFinders(
		registrator -> {
			registrator.register(
				_COMPANY_ID, _APPLICATION_NAME, application1ScopeFinder);
			registrator.register(
				_COMPANY_ID, applicationName2, application2ScopeFinder);
		}
	).build();
	Collection<String> application1ScopeAliases =
		scopeLocatorImpl.getScopeAliases(_COMPANY_ID, _APPLICATION_NAME);
	Collection<String> application2ScopesAliasesDefault =
		scopeLocatorImpl.getScopeAliases(_COMPANY_ID, applicationName2);
	for (String scope : scopesSet1) {
		Assert.assertThat(application1ScopeAliases, hasItem(scope));
	}
	for (String scope : scopedSet2) {
		Assert.assertThat(application2ScopesAliasesDefault, hasItem(scope));
	}
	Assert.assertNotEquals(
		application1ScopeAliases, application2ScopesAliasesDefault);
}