@Test
void throwsExceptionEncoding() {

    assertThrows(InvalidEntityException.class, () -> {
        EntityIdEndec.encode(1L << SHARD_BITS, 0, 0);
    });
    assertThrows(InvalidEntityException.class, () -> {
        EntityIdEndec.encode(0, 1L << REALM_BITS, 0);
    });
    assertThrows(InvalidEntityException.class, () -> {
        EntityIdEndec.encode(0, 0, 1L << NUM_BITS);
    });
    assertThrows(InvalidEntityException.class, () -> {
        EntityIdEndec.encode(-1, 0, 0);
    });
    assertThrows(InvalidEntityException.class, () -> {
        EntityIdEndec.encode(0, -1, 0);
    });
    assertThrows(InvalidEntityException.class, () -> {
        EntityIdEndec.encode(0, 0, -1);
    });
}