Add unit test to validate previous changes (write() accepts empty string, but not null).