GeneratorPid { ErlangPid generate () { int nextId = nextId(); int nextSerial = nextSerial(nextId); return ErlangPid.builder() .node(fullName) .id(nextId) .serial(nextSerial) .creation(creation) .build(); }    }
@Test public void generate () { val descriptor = NodeDescriptor.from("popa"); val creation = 1; val generator = new GeneratorPid(descriptor.getFullName(), creation); val pid = generator.generate(); assertThat(pid).isNotNull(); SoftAssertions.assertSoftly(softly -> { softly.assertThat(pid.getDescriptor().getFullName()) .isNotNull() .isEqualTo(descriptor.getFullName()); softly.assertThat(pid.getId()) .isEqualTo(1); softly.assertThat(pid.getSerial()) .isEqualTo(0); softly.assertThat(pid.getCreation()) .isEqualTo(creation); }); }