@Test
public void testScopeTokensLevelOne() {

    List<MetricSchemaRecord> records = new ArrayList<>();
    records.add(new MetricSchemaRecord(null, "scope1.foo", "metric0", "source", "unittest"));
    records.add(new MetricSchemaRecord(null, "scope1.foo", "metric1", "source", "unittest"));
    records.add(new MetricSchemaRecord(null, "scope2.bar", "metric2", "source", "unittest"));
    records.add(new MetricSchemaRecord(null, "scope2.bar", "metric3", "source", "unittest"));
    records.add(new MetricSchemaRecord(null, "scope2.bar", "metric4", "source", "unittest"));
    SortedSet<String> scopes = MetricSchemaRecordTokenizer.GetUniqueTokens(records, SchemaService.RecordType.SCOPE, 1);
    assertTrue(scopes.size() == 2);
    assertTrue(scopes.contains("foo"));
    assertTrue(scopes.contains("bar"));
}