<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def write_json_file(self, path):
 """ Write the instance in JSON format to a file. """

        with open(path, 'w') as f:
            json.dump(self.to_dict(), f, indent=2)