@Test public void testBind_WeakReferencedBinding() { BindingContext context = new BindingContext(); ReferenceQueue<TestUiComponent> referenceQueue = new ReferenceQueue<>(); Thread refRemoveThread = new Thread(() -> { try { TestUiComponent removed = referenceQueue.remove(10_000).get(); assertThat(weakRefComponent.get(), is(removed)); } catch (IllegalArgumentException | InterruptedException e) { throw new RuntimeException(e); } }); refRemoveThread.start(); weakRefComponent = setupBindingForWeakRefTest(context, referenceQueue); System.gc(); try { refRemoveThread.join(10_000); } catch (InterruptedException e) { fail(e); } assertThat(context.getBindings(), is(empty())); }
public Collection<Binding> getBindings() { return Collections.unmodifiableCollection(getBindingStream() .collect(toList())); }
BindingContext implements UiUpdateObserver { public Collection<Binding> getBindings() { return Collections.unmodifiableCollection(getBindingStream() .collect(toList())); } }
BindingContext implements UiUpdateObserver { public Collection<Binding> getBindings() { return Collections.unmodifiableCollection(getBindingStream() .collect(toList())); } BindingContext();  BindingContext(String contextName);  BindingContext(String contextName, PropertyBehaviorProvider behaviorProvider,
            Handler afterUpdateHandler);  BindingContext(String contextName, PropertyBehaviorProvider behaviorProvider,
            PropertyDispatcherFactory dispatcherFactory, Handler afterUpdateHandler); }
BindingContext implements UiUpdateObserver { public Collection<Binding> getBindings() { return Collections.unmodifiableCollection(getBindingStream() .collect(toList())); } BindingContext();  BindingContext(String contextName);  BindingContext(String contextName, PropertyBehaviorProvider behaviorProvider,
            Handler afterUpdateHandler);  BindingContext(String contextName, PropertyBehaviorProvider behaviorProvider,
            PropertyDispatcherFactory dispatcherFactory, Handler afterUpdateHandler); String getName(); @Deprecated BindingContext add(Binding binding); BindingContext add(Binding binding, ComponentWrapper componentWrapper); Collection<Binding> getBindings(); void removeBindingsForComponent(Object uiComponent); void removeBindingsForPmo(Object pmo); @Deprecated void updateUI(); void modelChanged(); @Override void uiUpdated(); @Deprecated final void updateMessages(MessageList messages); MessageList displayMessages(MessageList messages); PropertyBehaviorProvider getBehaviorProvider(); @Override String toString(); Binding bind(Object pmo,
            BindingDescriptor bindingDescriptor,
            ComponentWrapper componentWrapper); Binding bind(Object pmo,
            BoundProperty boundProperty,
            List<LinkkiAspectDefinition> aspectDefs,
            ComponentWrapper componentWrapper); ContainerBinding bindContainer(Object pmo,
            BoundProperty boundProperty,
            List<LinkkiAspectDefinition> aspectDefs,
            ComponentWrapper componentWrapper); @Deprecated final PropertyDispatcher createDispatcherChain(Object pmo,
            BindingDescriptor bindingDescriptor); }
BindingContext implements UiUpdateObserver { public Collection<Binding> getBindings() { return Collections.unmodifiableCollection(getBindingStream() .collect(toList())); } BindingContext();  BindingContext(String contextName);  BindingContext(String contextName, PropertyBehaviorProvider behaviorProvider,
            Handler afterUpdateHandler);  BindingContext(String contextName, PropertyBehaviorProvider behaviorProvider,
            PropertyDispatcherFactory dispatcherFactory, Handler afterUpdateHandler); String getName(); @Deprecated BindingContext add(Binding binding); BindingContext add(Binding binding, ComponentWrapper componentWrapper); Collection<Binding> getBindings(); void removeBindingsForComponent(Object uiComponent); void removeBindingsForPmo(Object pmo); @Deprecated void updateUI(); void modelChanged(); @Override void uiUpdated(); @Deprecated final void updateMessages(MessageList messages); MessageList displayMessages(MessageList messages); PropertyBehaviorProvider getBehaviorProvider(); @Override String toString(); Binding bind(Object pmo,
            BindingDescriptor bindingDescriptor,
            ComponentWrapper componentWrapper); Binding bind(Object pmo,
            BoundProperty boundProperty,
            List<LinkkiAspectDefinition> aspectDefs,
            ComponentWrapper componentWrapper); ContainerBinding bindContainer(Object pmo,
            BoundProperty boundProperty,
            List<LinkkiAspectDefinition> aspectDefs,
            ComponentWrapper componentWrapper); @Deprecated final PropertyDispatcher createDispatcherChain(Object pmo,
            BindingDescriptor bindingDescriptor);  }