title: I have a problem and I can't write a test for this fuctions
body: <p>This is my code, and I can't write a test for scanning input in the second function. The first function is for separate words that they contain + or - or &quot; &quot;. The second function is for categorizing query, for example you give &quot;mom dad +sister +sisi -brother -bro&quot;  and then split the word by &quot; &quot; and then calling the first function.</p>
  <pre><code>package Phase2;
  import Phase2.QueryKeeper;
  
  import java.util.HashSet;
  import java.util.Scanner;
  import java.util.Set;
  
  public class QueryCategorizer {
  
      private final QueryKeeper queryKeeper = new QueryKeeper();
  
      private void separateBySign(String[] query) {
          Set&lt;String&gt; plusContain = new HashSet&lt;&gt;();
          Set&lt;String&gt; minusContain = new HashSet&lt;&gt;();
          Set&lt;String&gt; withoutContain = new HashSet&lt;&gt;();
  
          for (String queryIterator : query) {
              if (queryIterator.contains(&quot;+&quot;)) {
                  plusContain.add(queryIterator.substring(1));
              } else if (queryIterator.contains(&quot;-&quot;)) {
                  minusContain.add(queryIterator.substring(1));
              } else {
                  withoutContain.add(queryIterator);
              }
          }
          queryKeeper.addAllSets(plusContain,minusContain,withoutContain);
  
      }
  
      public void categorizeQuery() {
          Scanner scanner = new Scanner(System.in);
          System.out.println(&quot;Please enter a query&quot;);
          String query = scanner.nextLine();
          separateBySign(query.split(&quot; &quot;));
      }
  
      public QueryKeeper getQueryKeeper() {
          return queryKeeper;
      }
  
  }
  </code></pre>