Skip to content

Instantly share code, notes, and snippets.

View SadiinsoSnowfall's full-sized avatar

Sadiinso SadiinsoSnowfall

  • France
View GitHub Profile
@SadiinsoSnowfall
SadiinsoSnowfall / deepToString.java
Last active July 17, 2019 15:08
Functions to get the String representation of any Java Object
/**
* After some benchmarking with JMH, I found that the best way to implement the part that manage maps and collections was
* to use an Iterator and its built-in function that take a lambda (forEachRemaning).
* List of others solutions I tried:
* - Iterator (using for...in loop)
* - Iterator + while loop
* - Spliterator + Stream
* - Spliterator + lambda
*/
public class DeepToString {