### Question:
DefaultPathRoleMatcher implements TreePathRoleMatcher { @Override public void matchRole(Subject auToken) { if (!isTreeInit) { logger.error("DefaultPathRoleMatcher -> root tree is not init"); throw new SurenessNoInitException("DefaultPathRoleMatcher -> root tree is not init"); } String targetResource = (String) auToken.getTargetResource(); String matchRoleString = root.searchPathFilterRoles(targetResource); if (matchRoleString != null && matchRoleString.startsWith(LEFT_CON) && matchRoleString.endsWith(RIGHT_CON)) { if (NULL_ROLE.equals(matchRoleString)) { auToken.setSupportRoles(new ArrayList<>(0)); } else { String[] roles = matchRoleString.substring(1, matchRoleString.length()-1).split(","); auToken.setSupportRoles(Arrays.asList(roles)); } } }  @Override void matchRole(Subject auToken); @Override void buildTree(); @Override void rebuildTree(); @Override boolean isExcludedResource(Subject request); void setPathTreeProvider(PathTreeProvider pathTreeProvider);  }### Answer:
@Test public void matchRole() { buildTree(); Subject subject = PasswordSubject.builder("tom", "123") .setTargetResource("/api/v2/host===get").build(); pathRoleMatcher.matchRole(subject); assertNotNull(subject.getSupportRoles()); assertTrue((subject.getSupportRoles() instanceof List)); }