### Question:
LineParser { static Object parseTermExpression(String s) { int len = s.length(); if (len == 1) { char ch = s.charAt(0); if (ch == WILDCARD) { return new ValidationError("Missing prefix for wildcard " + WILDCARD); } Term term = new Term(new char[]{ch}, 0, 1, null); return Collections.singletonList(term); } List<Term> terms = new LinkedList<>(); for (String part : s.split("\\s+")) { if (part.length() > 0) { terms.add(parseTerm(part)); } } return terms; }  static Object parse(final String line, final Input previousInput,
                               final QuerqyParserFactory querqyParserFactory); static Object parseDecorateInstruction(String line); static Object parseBoostInstruction(String line, String lcLine, int lengthPredicate, BoostDirection direction, QuerqyParserFactory querqyParserFactory); @SuppressWarnings("unchecked") static Object parseInput(String s); static Term parseTerm(String s); static List<String> parseFieldNames(String s); static final char BOUNDARY; static final char WILDCARD; static final String INSTR_BOOST_DOWN; static final String INSTR_BOOST_UP; static final String INSTR_DECORATE; static final String INSTR_DELETE; static final String INSTR_FILTER; static final String INSTR_SYNONYM; }### Answer:
@SuppressWarnings("unchecked") @Test public void testParseTermExpressionSingleTerm() { assertThat((List<Term>) LineParser.parseTermExpression("abc"), contains(term("abc"))); }
@SuppressWarnings("unchecked") @Test public void testParseTermExpressionSingleLetter() { assertThat((List<Term>) LineParser.parseTermExpression("a"), contains(term("a"))); }
@SuppressWarnings("unchecked") @Test public void testParseTermExpressionMultipleTerms() { assertThat((List<Term>) LineParser.parseTermExpression("abc def"), contains(term("abc"), term("def"))); }
@SuppressWarnings("unchecked") @Test public void testParseTermExpressionMultiplePrefixes() { assertThat((List<Term>) LineParser.parseTermExpression("abc* def*"), contains(prefix("abc"), prefix("def"))); }
@SuppressWarnings("unchecked") @Test public void testParseTermExpressionMixed() { assertThat((List<Term>) LineParser.parseTermExpression("abc* def ghij* klmn"), contains(prefix("abc"), term("def"), prefix("ghij"), term("klmn"))); }
@Test public void testParseTermExpressionDoesNotAllowAWildCardOnly() { assertTrue("parseTermExpression must not allow single wild card", LineParser.parseTermExpression("*") instanceof ValidationError); }