FileSink: Question Write a component (i.e. a Class) which writes log messages (i.e. Strings) to the file system. The component should be designed to be non-blocking. The component should write to a single active file. It should be thread safe, such that multiple threads can write to it concurrently. It's configuration parameters should be: directoryPath - The directory in which the log files will be saved Your class should implement the following interface: public interface FileSink { void write(String logMessage); } Test your answer by writing tests (through JUnit or a main method) which validates the following scenarios: Writing one line Writing multiple lines Writing multiple lines from multiple threads Make sure your test verifies that all the messages written to the FileSink are actually there Each thread should write 10,000 unique messages Each test should validate that the scenario actually worked (not manually by inspecting the output) Important Note: Make sure to have a working software by the end of the time limit. Time limit: 2 hours Good luck!
Check out your Company Bowl for anonymous work chats.