### Question:
EntityAsserts { public static void assertAttributeChangesEventually(final Entity entity, final AttributeSensor<?> attribute) { final Object origValue = entity.getAttribute(attribute); final AtomicBoolean changed = new AtomicBoolean(); SubscriptionHandle handle = entity.subscriptions().subscribe(entity, attribute, new SensorEventListener<Object>() { @Override public void onEvent(SensorEvent<Object> event) { if (!Objects.equal(origValue, event.getValue())) { changed.set(true); } }}); try { Asserts.succeedsEventually(new Runnable() { @Override public void run() { Asserts.assertTrue(changed.get(), entity + " -> " + attribute + " not changed"); }}); } finally { entity.subscriptions().unsubscribe(entity, handle); } }  static void assertAttributeEquals(Entity entity, AttributeSensor<T> attribute, T expected); static void assertConfigEquals(Entity entity, ConfigKey<T> configKey, T expected); static void assertAttributeEqualsEventually(final Entity entity, final AttributeSensor<T> attribute, final T expected); static void assertAttributeEqualsEventually(Map<?,?> flags, final Entity entity, final AttributeSensor<T> attribute, final T expected); static T assertAttributeEventuallyNonNull(final Entity entity, final AttributeSensor<T> attribute); static T assertAttributeEventuallyNonNull(Map<?,?> flags, final Entity entity, final AttributeSensor<T> attribute); static T assertAttributeEventually(final Entity entity, final AttributeSensor<T> attribute, Predicate<? super T> predicate); static T assertAttributeEventually(Map<?,?> flags, final Entity entity, final AttributeSensor<T> attribute, final Predicate<? super T> predicate); static T assertAttribute(final Entity entity, final AttributeSensor<T> attribute, final Predicate<? super T> predicate); static void assertPredicateEventuallyTrue(final T entity, final Predicate<? super T> predicate); static void assertPredicateEventuallyTrue(Map<?,?> flags, final T entity, final Predicate<? super T> predicate); static void assertAttributeEqualsContinually(final Entity entity, final AttributeSensor<T> attribute, final T expected); static void assertAttributeEqualsContinually(Map<?,?> flags, final Entity entity, final AttributeSensor<T> attribute, final T expected); static void assertGroupSizeEqualsEventually(final Group group, int expected); static void assertGroupSizeEqualsEventually(Map<?,?> flags, final Group group, final int expected); static void assertAttributeChangesEventually(final Entity entity, final AttributeSensor<?> attribute); @Beta @SafeVarargs static void assertAttributeContinuallyNotEqualTo(final Entity entity, final AttributeSensor<T> attribute, T... disallowed); @Beta @SafeVarargs static void assertAttributeContinuallyNotEqualTo(final Map<?, ?> flags, final Entity entity, final AttributeSensor<T> attribute, T... disallowed);  }### Answer:
@Test(groups="Integration") public void shouldAssertAttributeChangesEventually () { entity.sensors().set(TestEntity.NAME, "before"); setSensorValueLater(TestEntity.NAME, "after", Duration.seconds(2)); EntityAsserts.assertAttributeChangesEventually(entity, TestEntity.NAME); }