@Test
public void testSplitByRootName() throws Exception {

    Map<String, String> properties = asMap(
            "my.a", "valueA",
            "my.b", "valueB",
            "your.x", "valueX",
            "your.y", "valueY"
    );
    Map<String, Map<String, String>> groups = PropertiesExt.groupByRootName(properties, 1);
    assertThat(groups).hasSize(2);
    assertThat(groups.get("my")).containsAllEntriesOf(asMap("a", "valueA", "b", "valueB"));
    assertThat(groups.get("your")).containsAllEntriesOf(asMap("y", "valueX", "y", "valueY"));
}