Here you can find the source of trimSuffix(List
private static List<String> trimSuffix(List<String> strs)
//package com.java2s; //License from project: Apache License import java.util.Arrays; import java.util.List; public class Main { private static final List<String> SUFFIXES = Arrays.asList("preview"); private static List<String> trimSuffix(List<String> strs) { String endStr = strs.get(strs.size() - 1); if (SUFFIXES.contains(endStr)) { strs.remove(strs.size() - 1); }//w w w . j ava 2s . c o m return strs; } }