shapeless
shapeless copied to clipboard
enum value should be serializable and should also keep referential integrity
// let say that "enum" WeekDay with value Mon is defined
// then this test should be ok:
val out = new ByteArrayOutputStream()
new ObjectOutputStream(out).writeObject(Mon);
out.close();
val monday = new ObjectInputStream(new ByteArrayInputStream(out.toByteArray)).readObject()
assert(monday == Mon)