@Test
public void newInstance () {

  val node = "popa";
  val id = 500;
  val serial = 10;
  val creation = 42;
  val bytes = Bytes.resizableArray()
      .write1B(PID.getCode())
      .writeNB(new ErlangAtom(node).toBytes())
      .write4B(id & 0x7FFF)
      .write4B(serial & 0x1FFF)
      .write1B(creation & 0x3)
      .arrayCopy();
  ErlangPid pid = ErlangTerm.newInstance(wrappedBuffer(bytes));
  assertThat(pid).isNotNull();
  SoftAssertions.assertSoftly(softly -> {
    softly.assertThat(pid.getDescriptor().getNodeName())
        .isEqualTo(node);
    softly.assertThat(pid.getId())
        .isEqualTo(id & 0x7FFF);
    softly.assertThat(pid.getSerial())
        .isEqualTo(serial & 0x1FFF);
    softly.assertThat(pid.getCreation())
        .isEqualTo(creation & 0x3);
  });
}