### Question:
ModelObjects { public static boolean isAccessible(Object pmo, String modelObjectName) { return getModelObjectAccessMember(pmo, modelObjectName).isPresent(); } private  ModelObjects(Class<?> pmoClass, String modelObjectName); static Supplier<Object> supplierFor(Object pmo, String modelObjectName); static boolean isAccessible(Object pmo, String modelObjectName);  }### Answer:
@Test public void testHasModelObjectAnnotatedMethod() { assertThat(ModelObjects.isAccessible(new TestPmo(), ModelObject.DEFAULT_NAME), is(true)); assertThat(ModelObjects.isAccessible(new PmoWithNamedModelObject(), PmoWithNamedModelObject.MODEL_OBJECT), is(true)); assertThat(ModelObjects.isAccessible(new PmoWithNamedModelObject(), ModelObject.DEFAULT_NAME), is(true)); }
@Test public void testHasModelObjectAnnotatedMethod_noAnnotation() { assertThat(ModelObjects.isAccessible(new Object(), ModelObject.DEFAULT_NAME), is(false)); }
@Test public void testHasModelObjectAnnotatedMethod_noMatchingAnnotation() { assertThat(ModelObjects.isAccessible(new PmoWithNamedModelObject(), "someOtherName"), is(false)); assertThat(ModelObjects.isAccessible(new Object(), "FooBar"), is(false)); }