### Question:
UIElementAnnotationReader { @Deprecated public static boolean hasModelObjectAnnotation(Object pmo, String modelObjectName) { try { return ModelObjects.isAccessible(pmo, modelObjectName); } catch (org.linkki.core.binding.descriptor.modelobject.ModelObjects.ModelObjectAnnotationException e) { throw new ModelObjectAnnotationException(e.getMessage()); } } UIElementAnnotationReader(Class<?> annotatedClass); PropertyElementDescriptors findDescriptors(String propertyName); Stream<PropertyElementDescriptors> getUiElements(); @Deprecated static Supplier<?> getModelObjectSupplier(Object pmo, String modelObjectName); @Deprecated static boolean hasModelObjectAnnotation(Object pmo, String modelObjectName);  }### Answer:
@SuppressWarnings("deprecation") @Test public void testHasModelObjectAnnotatedMethod() { assertThat(UIElementAnnotationReader.hasModelObjectAnnotation(new TestPmo(), ModelObject.DEFAULT_NAME), is(true)); assertThat(UIElementAnnotationReader.hasModelObjectAnnotation(new PmoWithNamedModelObject(), PmoWithNamedModelObject.MODEL_OBJECT), is(true)); assertThat(UIElementAnnotationReader.hasModelObjectAnnotation(new PmoWithNamedModelObject(), ModelObject.DEFAULT_NAME), is(true)); }
@SuppressWarnings("deprecation") @Test public void testHasModelObjectAnnotatedMethod_noAnnotation() { assertThat(UIElementAnnotationReader.hasModelObjectAnnotation(new Object(), ModelObject.DEFAULT_NAME), is(false)); }
@SuppressWarnings("deprecation") @Test public void testHasModelObjectAnnotatedMethod_noMatchingAnnotation() { assertThat(UIElementAnnotationReader.hasModelObjectAnnotation(new PmoWithNamedModelObject(), "someOtherName"), is(false)); assertThat(UIElementAnnotationReader.hasModelObjectAnnotation(new Object(), "FooBar"), is(false)); }