@Test(expected = IllegalStateException.class) public void setLinkIdWhenAlreadySet() { try { link.setLinkId(LinkId.of("bar")); fail(); } catch (IllegalStateException e) { assertThat(e.getMessage()).isEqualTo("LinkId may only be set once"); throw e; } }
@Override public void setLinkId(final LinkId linkId) { if (!this.linkId.compareAndSet(null, Objects.requireNonNull(linkId))) { throw new IllegalStateException("LinkId may only be set once"); } }
AbstractLink implements Link<L> { @Override public void setLinkId(final LinkId linkId) { if (!this.linkId.compareAndSet(null, Objects.requireNonNull(linkId))) { throw new IllegalStateException("LinkId may only be set once"); } } }
AbstractLink implements Link<L> { @Override public void setLinkId(final LinkId linkId) { if (!this.linkId.compareAndSet(null, Objects.requireNonNull(linkId))) { throw new IllegalStateException("LinkId may only be set once"); } } protected  AbstractLink(
      final Supplier<InterledgerAddress> operatorAddressSupplier,
      final L linkSettings
  ); }
AbstractLink implements Link<L> { @Override public void setLinkId(final LinkId linkId) { if (!this.linkId.compareAndSet(null, Objects.requireNonNull(linkId))) { throw new IllegalStateException("LinkId may only be set once"); } } protected  AbstractLink(
      final Supplier<InterledgerAddress> operatorAddressSupplier,
      final L linkSettings
  ); @Override LinkId getLinkId(); @Override void setLinkId(final LinkId linkId); @Override Supplier<InterledgerAddress> getOperatorAddressSupplier(); @Override L getLinkSettings(); @Override void registerLinkHandler(final LinkHandler ilpDataHandler); @Override void unregisterLinkHandler(); @Override Optional<LinkHandler> getLinkHandler(); @Override String toString(); }
AbstractLink implements Link<L> { @Override public void setLinkId(final LinkId linkId) { if (!this.linkId.compareAndSet(null, Objects.requireNonNull(linkId))) { throw new IllegalStateException("LinkId may only be set once"); } } protected  AbstractLink(
      final Supplier<InterledgerAddress> operatorAddressSupplier,
      final L linkSettings
  ); @Override LinkId getLinkId(); @Override void setLinkId(final LinkId linkId); @Override Supplier<InterledgerAddress> getOperatorAddressSupplier(); @Override L getLinkSettings(); @Override void registerLinkHandler(final LinkHandler ilpDataHandler); @Override void unregisterLinkHandler(); @Override Optional<LinkHandler> getLinkHandler(); @Override String toString();  }