SopremoRecord extends AbstractSopremoType implements ISopremoType { public IJsonNode getOrParseNode() { if (this.node == null) return this.node = this.parseNode(); return this.node; } SopremoRecord(SopremoRecordLayout layout, ITypeRegistry registry);  SopremoRecord(); @Override void appendAsString(final Appendable appendable); void copyTo(final SopremoRecord to); @Override boolean equals(final Object obj); IJsonNode getKey(final int expressionIndex, final NodeCache nodeCache); IJsonNode getNode(); IJsonNode getOrParseNode(); IJsonNode getValueAtOffset(final int offset, final NodeCache nodeCache); @Override int hashCode(); IJsonNode parseNode(); void setNode(final IJsonNode node);  }
@Test public void testObjectSerialization() throws IOException { final IJsonNode node = JsonUtil.createObjectNode("a", 1, "b", 2); final SopremoRecord sopremoRecord2 = this.serializeAndDeserialize(node, SopremoRecordLayout.create()); Assert.assertEquals(node, sopremoRecord2.getOrParseNode()); Assert.assertNotSame(node, sopremoRecord2.getOrParseNode()); }
@Test public void testPrimitiveSerialization() throws IOException { final IJsonNode node = new IntNode(42); final SopremoRecord sopremoRecord2 = this.serializeAndDeserialize(node, SopremoRecordLayout.create()); Assert.assertEquals(node, sopremoRecord2.getOrParseNode()); Assert.assertNotSame(node, sopremoRecord2.getOrParseNode()); }