input: Write a function to generate a Python class that reads in a text file and counts the frequency of each word. The class should have an initialization method that takes the filename as an argument, a method to process the file, and a method to retrieve the word counts.
  
  class WordCounter:
      def __init__(self, filename):
          self.word_counts = {}
          self.filename = filename
          self.process_file()
  
      def process_file(self):
          with open(self.filename) as f:
              for line in f:
                  words = line.split()
                  for word in words:
                      if word in self.word_counts:
                          self.word_counts[word] += 1
                      else:
                          self.word_counts[word] = 1
  
      def get_word_counts(self):
          return self.word_counts
  
  assert WordCounter('test1.txt').get_word_counts() == {'the': 2, 'quick': 1, 'brown': 1, 'fox': 1, 'jumped': 1, 'over': 1}
  assert WordCounter('test2.txt').get_word_counts() == {'hello': 3, 'world': 1, 'how': 1, 'are': 1, 'you': 1}
  assert WordCounter('test3.txt').get_word_counts() == {}
output: class WordCounter:
      def __init__(self, filename):
          self.word_counts = {}
          self.filename = filename
          self.process_file()
  
      def process_file(self):
          with open(self.filename) as f:
              for line in f:
                  words = line.split()
                  for word in words:
                      if word in self.word_counts:
                          self.word_counts[word] += 1
                      else:
                          self.word_counts[word] = 1
  
      def get_word_counts(self):
          return self.word_counts