Skip to content

Instantly share code, notes, and snippets.

@LenarBad LenarBad/CloneList.java
Last active Nov 20, 2017

Embed
What would you like to do?
Clone lists in Java with Gson
private List<User> testUsers;
public List<User> getTestUsers() {
Gson gson = new Gson();
return Arrays.asList(gson.fromJson(gson.toJson(testUsers), User[].class));
}
@LenarBad

This comment has been minimized.

Copy link
Owner Author

LenarBad commented Nov 20, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.