### Question:
PropertiesFile { public static PropertiesFile of(CharSource source) { ArgChecker.notNull(source, "source"); ImmutableList<String> lines = Unchecked.wrap(() -> source.readLines()); PropertySet keyValues = parse(lines); return new PropertiesFile(keyValues); } private  PropertiesFile(PropertySet keyValueMap); static PropertiesFile of(CharSource source); static PropertiesFile of(PropertySet keyValueMap); PropertySet getProperties(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void test_of_invalid_emptyKey() { String invalid = "= y\n"; assertThatIllegalArgumentException().isThrownBy(() -> PropertiesFile.of(CharSource.wrap(invalid))); }
@Test public void test_of_ioException() { assertThatExceptionOfType(UncheckedIOException.class).isThrownBy( () -> PropertiesFile.of(Files.asCharSource(new File("src/test/resources"), StandardCharsets.UTF_8))); }