This code takes a java bean and tries to serialize it as java code that sets recursively all the fields. This is useful if you want to mock an object and already get the object somewhere but you want to put it in the code.
This should be used together with mockito and https://github.com/ManuelB/mockito-caching-spy
To see a code example:
To use it add the following maven dependency:
<dependency>
<groupId>de.incentergy.test</groupId>
<artifactId>java-bean-to-code-serializer</artifactId>
<version>0.10</version>
</dependency>