@Test
public void testGetCanonicalFragments() {

  final Object[][] testParameters =
      new Object[][] {{"/Users/tester", new String[] {"Users", "tester"}},
          {"/Users/admin/systems", new String[] {"Users", "admin", "systems"}},
          {"./tests/./subtest1", new String[] {"tests", "subtest1"}},
          {"././tests/../subtest2", new String[] {"subtest2"}}};
  for (final Object[] testParameter : testParameters) {
    String[] expected = (String[]) testParameter[1];
    String path = (String) testParameter[0];
    for (int i = 0; i < expected.length; ++i) {
      assertEquals(expected[i], FilepathUtils.getCanonicalFragments(path)[i]);
    }
  }
}