Here you can find the source of getLastNameIndex(List
private static int getLastNameIndex(List<String> list)
//package com.java2s; import java.util.List; import java.util.Set; public class Main { static Set<String> personStopWordSet; private static int getLastNameIndex(List<String> list) { for (int i = list.size() - 1; i >= 0; i--) { if ((list.get(i).length() > 1) && (!personStopWordSet.contains(list.get(i)))) { return i; }//w w w. j a v a 2 s . c o m } return -1; } }