Here you can find the source of splitGenericIfNeeded(String name)
public static List<String> splitGenericIfNeeded(String name)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class Main { public static List<String> splitGenericIfNeeded(String name) { List<String> result = new ArrayList<>(); if (name.contains("<")) { result.add(name.substring(0, name.indexOf("<")).trim()); for (String item : Arrays.asList(name.substring(name.indexOf("<") + 1, name.indexOf(">")).split(","))) { result.add(item.trim()); }//from w ww . j a va 2s .c om } else { result.add(name); } return result; } }