@Test public void prefixListTest() { PrefixList prefixList = new PrefixList(ImmutableList.<String> of("test", "apple", "sun")); Assert.assertTrue(prefixList.inList("test")); Assert.assertTrue(prefixList.inList("apple")); Assert.assertTrue(prefixList.inList("sun")); Assert.assertTrue(prefixList.inList("test123")); Assert.assertTrue(prefixList.inList("testing-1012")); Assert.assertTrue(prefixList.inList("apple12nmzx91l")); Assert.assertTrue(prefixList.inList("sunn1i2080-40mx")); Assert.assertFalse(prefixList.outList("test123")); Assert.assertFalse(prefixList.outList("testing-1012")); Assert.assertFalse(prefixList.outList("apple12nmzx91l")); Assert.assertFalse(prefixList.outList("sunn1i2080-40mx")); Assert.assertTrue(prefixList.outList("tes")); Assert.assertTrue(prefixList.outList("a")); Assert.assertTrue(prefixList.outList("s")); Assert.assertTrue(prefixList.outList("su")); Assert.assertTrue(prefixList.outList("ap")); Assert.assertTrue(prefixList.outList("")); Assert.assertTrue(prefixList.outList(null)); }
public PrefixList(List<String> prefixList) { if (prefixList == null) { LIST = new ArrayList<String>(0); } else { LIST = prefixList; } }
PrefixList { public PrefixList(List<String> prefixList) { if (prefixList == null) { LIST = new ArrayList<String>(0); } else { LIST = prefixList; } } }
PrefixList { public PrefixList(List<String> prefixList) { if (prefixList == null) { LIST = new ArrayList<String>(0); } else { LIST = prefixList; } } PrefixList(List<String> prefixList);  PrefixList(String prefixes, String separator); }
PrefixList { public PrefixList(List<String> prefixList) { if (prefixList == null) { LIST = new ArrayList<String>(0); } else { LIST = prefixList; } } PrefixList(List<String> prefixList);  PrefixList(String prefixes, String separator); List<String> getList(); boolean inList(String path); boolean outList(String path); @Override String toString(); }
PrefixList { public PrefixList(List<String> prefixList) { if (prefixList == null) { LIST = new ArrayList<String>(0); } else { LIST = prefixList; } } PrefixList(List<String> prefixList);  PrefixList(String prefixes, String separator); List<String> getList(); boolean inList(String path); boolean outList(String path); @Override String toString();  }