@Test public void newInstance () { val value = new ErlangNil(); val bytes = Bytes.resizableArray() .write1B(SMALL_TUPLE.getCode()) .write1B(1) .writeNB(value.toBytes()) .arrayCopy(); ErlangTuple tuple = ErlangTerm.newInstance(wrappedBuffer(bytes)); assertThat(tuple).isNotNull(); SoftAssertions.assertSoftly(softly -> { softly.assertThat(tuple.isCollectionTerm()) .isTrue(); softly.assertThat(tuple.isTuple()) .isTrue(); softly.assertThat(tuple.get(0)) .isPresent() .hasValue(value); softly.assertThat(tuple.size()) .isEqualTo(1); }); }
@Override public int size () { return elements.length; }
ErlangTuple extends ErlangTerm { @Override public int size () { return elements.length; } }
ErlangTuple extends ErlangTerm { @Override public int size () { return elements.length; } ErlangTuple(TermType type, @NonNull ByteBuf buffer);  ErlangTuple(ErlangTerm... elements); @Builder  ErlangTuple(@Singular Collection<ErlangTerm> adds); }
ErlangTuple extends ErlangTerm { @Override public int size () { return elements.length; } ErlangTuple(TermType type, @NonNull ByteBuf buffer);  ErlangTuple(ErlangTerm... elements); @Builder  ErlangTuple(@Singular Collection<ErlangTerm> adds); @Override ErlangTuple asTuple(); @Override Iterator<ErlangTerm> elements(); @Override ErlangTerm getUnsafe(int index); @Override int size(); }
ErlangTuple extends ErlangTerm { @Override public int size () { return elements.length; } ErlangTuple(TermType type, @NonNull ByteBuf buffer);  ErlangTuple(ErlangTerm... elements); @Builder  ErlangTuple(@Singular Collection<ErlangTerm> adds); @Override ErlangTuple asTuple(); @Override Iterator<ErlangTerm> elements(); @Override ErlangTerm getUnsafe(int index); @Override int size();  }