@Test public void testAutoCompleteSeeds() throws Exception { AutoCompleteSeeder seeder = new AutoCompleteSeeder(seed); assertEquals(expected, seeder.getSeeds()); }
public List<String> getSeeds() { List<String> terms = new ArrayList<String>(); boolean trailingQuote = source.endsWith("\""); boolean leadingQuote = source.startsWith("\""); boolean trailingSpace = source.endsWith(" "); if (trailingQuote || (trailingSpace && !leadingQuote)) { terms.add(""); } else { if (leadingQuote) { int quote = source.lastIndexOf('"'); if (quote == 0) { terms.add(source.substring(1)); } else { terms.add(""); } } else { int space = source.lastIndexOf(' '); if (space > -1) { terms.add(source.substring(space + 1)); } else { terms.add(source); } } } return terms; }
AutoCompleteSeeder { public List<String> getSeeds() { List<String> terms = new ArrayList<String>(); boolean trailingQuote = source.endsWith("\""); boolean leadingQuote = source.startsWith("\""); boolean trailingSpace = source.endsWith(" "); if (trailingQuote || (trailingSpace && !leadingQuote)) { terms.add(""); } else { if (leadingQuote) { int quote = source.lastIndexOf('"'); if (quote == 0) { terms.add(source.substring(1)); } else { terms.add(""); } } else { int space = source.lastIndexOf(' '); if (space > -1) { terms.add(source.substring(space + 1)); } else { terms.add(source); } } } return terms; } }
AutoCompleteSeeder { public List<String> getSeeds() { List<String> terms = new ArrayList<String>(); boolean trailingQuote = source.endsWith("\""); boolean leadingQuote = source.startsWith("\""); boolean trailingSpace = source.endsWith(" "); if (trailingQuote || (trailingSpace && !leadingQuote)) { terms.add(""); } else { if (leadingQuote) { int quote = source.lastIndexOf('"'); if (quote == 0) { terms.add(source.substring(1)); } else { terms.add(""); } } else { int space = source.lastIndexOf(' '); if (space > -1) { terms.add(source.substring(space + 1)); } else { terms.add(source); } } } return terms; } AutoCompleteSeeder(String source); }
AutoCompleteSeeder { public List<String> getSeeds() { List<String> terms = new ArrayList<String>(); boolean trailingQuote = source.endsWith("\""); boolean leadingQuote = source.startsWith("\""); boolean trailingSpace = source.endsWith(" "); if (trailingQuote || (trailingSpace && !leadingQuote)) { terms.add(""); } else { if (leadingQuote) { int quote = source.lastIndexOf('"'); if (quote == 0) { terms.add(source.substring(1)); } else { terms.add(""); } } else { int space = source.lastIndexOf(' '); if (space > -1) { terms.add(source.substring(space + 1)); } else { terms.add(source); } } } return terms; } AutoCompleteSeeder(String source); List<String> getSeeds(); }
AutoCompleteSeeder { public List<String> getSeeds() { List<String> terms = new ArrayList<String>(); boolean trailingQuote = source.endsWith("\""); boolean leadingQuote = source.startsWith("\""); boolean trailingSpace = source.endsWith(" "); if (trailingQuote || (trailingSpace && !leadingQuote)) { terms.add(""); } else { if (leadingQuote) { int quote = source.lastIndexOf('"'); if (quote == 0) { terms.add(source.substring(1)); } else { terms.add(""); } } else { int space = source.lastIndexOf(' '); if (space > -1) { terms.add(source.substring(space + 1)); } else { terms.add(source); } } } return terms; } AutoCompleteSeeder(String source); List<String> getSeeds();  }