### Question:
DefaultPathRoleMatcher implements TreePathRoleMatcher { @Override public void buildTree() { isTreeInit = false; checkComponentInit(); clearTree(); Set<String> resources = pathTreeProvider.providePathData(); Set<String> excludeResource = pathTreeProvider.provideExcludedResource(); if (resources != null) { resources = resources.stream().map(String::toLowerCase).collect(Collectors.toSet()); root.buildTree(resources); } else { logger.error("sureness - pathTreeProvider.providePathData is null, can not load resource"); } if (excludeResource != null) { excludeResource = excludeResource.stream() .map(resource -> resource.concat("===").concat(EXCLUDE_ROLE).toLowerCase()) .collect(Collectors.toSet()); excludeRoot.buildTree(excludeResource); } else { logger.error("sureness - pathTreeProvider.provideExcludedResource is null, can not exclude resource"); } isTreeInit = true; }  @Override void matchRole(Subject auToken); @Override void buildTree(); @Override void rebuildTree(); @Override boolean isExcludedResource(Subject request); void setPathTreeProvider(PathTreeProvider pathTreeProvider);  }### Answer:
@Test public void buildTree() { PathTreeProvider provider = createNiceMock(PathTreeProvider.class); expect(provider.providePathData()).andReturn(paths); replay(provider); pathRoleMatcher.setPathTreeProvider(provider); pathRoleMatcher.buildTree(); verify(provider); }