class FriendFileLoader {

    public T load() throws IOException, FriendFileLoaderException {
        final Gson gson = gsonSupplier.get();
        JsonObject rootObject = tryAsObject(new JsonParser().parse(new BufferedReader(new InputStreamReader(Files.newInputStream(this.readPath)))), "Root element of friends file must be a JSON object");
        JsonObject boundsObject = tryAsObject(rootObject.get("bounds"), "Bounds element of friends file must be a JSON object");
        Bounds bounds = gson.fromJson(boundsObject, Bounds.class);
        JsonArray listArray = tryAsArray(rootObject.get("list"));
        Set<S> persons = new HashSet<>();
        for (JsonElement element : listArray) {
            persons.add(gson.fromJson(element, this.personClass));
        }
        return this.factory.apply(bounds, persons);
    }

    private  FriendFileLoader(Class<S> personClass);

}