Java tutorial
//package com.java2s; import java.util.ArrayList; public class Main { private static boolean isValidSubString(ArrayList<String> list, String token) { if (list != null) { for (int i = 0; i < list.size(); ++i) { if (!((String) list.get(i)).startsWith(token)) { return false; } } return true; } else { return false; } } }