FriendFileSaver { public static <T extends Configuration<S>, S extends IPerson> void save(T configuration) throws IOException { FriendFileSaver.save(configuration, new Gson()); }  static void save(T configuration); static void save(T configuration, Gson gson); static void save(T configuration, Gson gson, Writer writer);  }
@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", "")); }