### Question:
Input { public List<ComparableCharSequence> getInputSequences(boolean lowerCaseValues) { if (inputTerms.size() == 1) { return inputTerms.get(0).getCharSequences(lowerCaseValues); } LinkedList<List<ComparableCharSequence>> slots = new LinkedList<>(); for (Term inputTerm : inputTerms) { slots.add(inputTerm.getCharSequences(lowerCaseValues)); } List<ComparableCharSequence> seqs = new LinkedList<>(); collectTails(new LinkedList<>(), slots, seqs); return seqs; } Input(final List<Term> inputTerms, final String matchExpression);  Input(final List<Term> inputTerms, final boolean requiresLeftBoundary, final boolean requiresRightBoundary,
                 final String matchExpression); boolean isEmpty(); List<ComparableCharSequence> getInputSequences(boolean lowerCaseValues); List<Term> getInputTerms(); @Override String toString(); boolean requiresLeftBoundary(); boolean requiresRightBoundary(); String getMatchExpression();  }### Answer:
@Test public void testGetInputSequencesForSingleTermWithoutFieldName() { char[] s1 = "test".toCharArray(); Term term1 = new Term(s1, 0, s1.length, null); Input input = new Input(Collections.singletonList(term1), false, false, "test"); List<ComparableCharSequence> sequences = input.getInputSequences(false); assertNotNull(sequences); assertEquals(1, sequences.size()); ComparableCharSequence seq = sequences.get(0); assertNotNull(seq); assertEquals(0, seq.compareTo("test")); }
@Test public void testGetInputSequencesForTermsWithoutFieldName() { char[] s1 = "test".toCharArray(); Term term1 = new Term(s1, 0, s1.length, null); char[] s2 = "test2".toCharArray(); Term term2 = new Term(s2, 0, s2.length, null); Input input = new Input(Arrays.asList(term1, term2), false, false, "test test2"); List<ComparableCharSequence> sequences = input.getInputSequences(false); assertNotNull(sequences); assertEquals(1, sequences.size()); ComparableCharSequence seq = sequences.get(0); assertNotNull(seq); assertEquals(0, seq.compareTo("test test2")); }
@Test public void testGetInputSequencesForSingleTermWithFieldName() { char[] s1 = "test".toCharArray(); Term term1 = new Term(s1, 0, s1.length, Arrays.asList("name1")); Input input = new Input(Collections.singletonList(term1), false, false, "name1:test"); List<ComparableCharSequence> sequences = input.getInputSequences(false); assertNotNull(sequences); assertEquals(1, sequences.size()); ComparableCharSequence seq = sequences.get(0); assertNotNull(seq); assertEquals(0, seq.compareTo("name1:test")); }
@Test public void testGetInputSequencesForSingleTermWithFieldNames() { char[] s1 = "test".toCharArray(); Term term1 = new Term(s1, 0, s1.length, Arrays.asList("name1", "name2")); Input input = new Input(Collections.singletonList(term1), false, false, "name1:test name2:test"); List<ComparableCharSequence> sequences = input.getInputSequences(false); assertNotNull(sequences); assertEquals(2, sequences.size()); ComparableCharSequence seq = sequences.get(0); assertNotNull(seq); assertEquals(0, seq.compareTo("name1:test")); seq = sequences.get(1); assertNotNull(seq); assertEquals(0, seq.compareTo("name2:test")); }