@Test public void getSubscriptions_mutability() { final EntityService entityService = Replicant.context().getEntityService(); final Entity entity = safeAction( () -> entityService.findOrCreateEntity( ValueUtil.randomString(), A.class, ValueUtil.randomInt() ) ); final Subscription subscription1 = createSubscription(); expectThrows( UnsupportedOperationException.class, () -> safeAction( () -> entity.getSubscriptions().add( subscription1 ) ) ); }
@Nonnull @Observable( expectSetter = false ) public Collection<Subscription> getSubscriptions() { return _subscriptions.values(); }
Entity extends ReplicantService { @Nonnull @Observable( expectSetter = false ) public Collection<Subscription> getSubscriptions() { return _subscriptions.values(); } }
Entity extends ReplicantService { @Nonnull @Observable( expectSetter = false ) public Collection<Subscription> getSubscriptions() { return _subscriptions.values(); } Entity( @Nullable final ReplicantContext context,
          @Nullable final String name,
          @Nonnull final Class<?> type,
          final int id ); }
Entity extends ReplicantService { @Nonnull @Observable( expectSetter = false ) public Collection<Subscription> getSubscriptions() { return _subscriptions.values(); } Entity( @Nullable final ReplicantContext context,
          @Nullable final String name,
          @Nonnull final Class<?> type,
          final int id ); @Nonnull String getName(); @Nonnull Class<?> getType(); int getId(); @Nonnull Object getUserObject(); @Observable( name = "userObject" ) @Nullable Object maybeUserObject(); @Nonnull @Observable( expectSetter = false ) Collection<Subscription> getSubscriptions(); @Override String toString(); }
Entity extends ReplicantService { @Nonnull @Observable( expectSetter = false ) public Collection<Subscription> getSubscriptions() { return _subscriptions.values(); } Entity( @Nullable final ReplicantContext context,
          @Nullable final String name,
          @Nonnull final Class<?> type,
          final int id ); @Nonnull String getName(); @Nonnull Class<?> getType(); int getId(); @Nonnull Object getUserObject(); @Observable( name = "userObject" ) @Nullable Object maybeUserObject(); @Nonnull @Observable( expectSetter = false ) Collection<Subscription> getSubscriptions(); @Override String toString();  }