@Test
@DisplayName("Saves identical configuration as input")
public void testSave() throws URISyntaxException, IOException, FriendFileLoaderException {

    Path sourceFile = TestUtil.getPath("friends.json");
    Configuration<Person> configuration = FriendFileLoader.loader(Person.class)
            .withPath(sourceFile)
            .withDefaultFactory()
            .load();
    StringWriter writer = new StringWriter();
    FriendFileSaver.save(configuration, new Gson(), writer);
    String output = writer.toString();
    assertEquals(readFile(sourceFile).replaceAll("\\s", ""), output.replaceAll("\\s", "")); // remove all whitespace so indents and random newlines don't matter
}