class CocoapodsBrowseNodeGenerator extends ComponentSupport implements BrowseNodeGenerator {

  @Override
  public List<BrowsePaths> computeAssetPaths(final Asset asset, @Nullable final Component component) {
    checkNotNull(asset);
    if (component != null) {
      List<BrowsePaths> paths = computeComponentPaths(asset, component);
      String viewName = cutResourceParams(lastSegment(asset.name()));
      BrowsePaths.appendPath(paths, viewName);
      return paths;
    }
    else {
      List<String> nameParts = Splitter.on('/').omitEmptyStrings().splitToList(cutResourceParams(asset.name()));
      return BrowsePaths.fromPaths(nameParts, false);
    }
  }

}