input: Write a Python class that reads in a text file and counts the frequency of each word.
  
  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
  
  # Test cases
  counter1 = WordCounter('example.txt')
  assert counter1.get_word_counts() == {'hello': 2, 'world': 1}
  
  counter2 = WordCounter('empty.txt')
  assert counter2.get_word_counts() == {}
  
  counter3 = WordCounter('long_text.txt')
  assert counter3.get_word_counts() == {'the': 5, 'quick': 1, 'brown': 1, 'fox': 1, 'jumps': 1, 'over': 1, 'lazy': 1, 'dog': 1}
  
  counter4 = WordCounter('numbers.txt')
  assert counter4.get_word_counts() == {'1': 3, '2': 2, '3': 1}
  
  counter5 = WordCounter('special_characters.txt')
  assert counter5.get_word_counts() == {'!@#$%': 2, '123': 1}
output: 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