How to call a List(names) which is inside in main(), names.stream().filter(Filter.nameStartingWithPrefix(scanner.nextLine()) in another class Filter) :    1. I want to call method name nameStartingWithPrefix() which is inside filter and its definition will be in Filter class. 
    All ArrayList describes in main(), but the list is not passed as in an argument, how can I call in List of names inside Filter.nameStartingWithPrefix(). 
    
    Syntax is given like: names is name of ArrayList which is inside main()
    names.stream()
                    .filter(Filter.nameStartingWithPrefix(scanner.nextLine()))
                    .map(Mapper.getDistinctCharactersCount())
                    .forEachOrdered(System.out::println);
    
        public class FilterMapper {
            private static final Scanner scanner = new Scanner(System.in);
           
            public static void main(String[] args) {
                List<String> names = Arrays.asList(
                        "aaryanna",
                        "aayanna",
                        "airianna",
                        "alassandra",
                        "allanna",
                        "allannah",
                        "allessandra",
                        "allianna",
                        "allyanna",
                        "anastaisa",
                        "anastashia",
                        "anastasia",
                        "annabella",
                        "annabelle",
                        "annebelle"
                );
               
                names.stream()
                        .filter(Filter.nameStartingWithPrefix(scanner.nextLine()))
                        .map(Mapper.getDistinctCharactersCount())
                        .forEachOrdered(System.out::println);
            }
        }
        
         class Filter{
        	
        	 public static String nameStartingWithPrefix(String prefix)
        	 {
        		 
        	 }
        }
    
  2.  Expected like, I have to write a code on Filter method which filters the names on the basis of prefix given by the user in runtime.
    But I am unable to access list on the basis of given code. can you please help me how to access List of names inside the Filter class.
    
   3. I think List should be passed in arguments of (Filter.nameStartingWithPrefix(scanner.nextLine()))
    but its not there.

