input: Write a function to implement the 'add' method in the 'Sum' class so that it can calculate the sum of two integers. If the given input is invalid then return None.
  class Sum:
      def __init__(self, x, y):
          self.x = x
          self.y = y
      def add(self):
          if isinstance(self.x, int) and isinstance(self.y, int):
              return self.x + self.y
          else:
              return None
  assert Sum(1, 2).add() == 3
  assert Sum(-1, -1).add() == -2
  assert Sum(0, 0).add() == 0
  assert Sum(1, 'a').add() == None
  assert Sum({}, 1).add() == None
output: def add(self):
      if isinstance(self.x, int) and isinstance(self.y, int):
          return self.x + self.y
      else:
          return None