### Question:
BindableDefinitionAdapterImpl implements BindableDefinitionAdapter<T> { @Override public Optional<?> getProperty(T pojo, String field) { DefinitionAdapterBindings b = bindings.get(pojo.getClass()); final int index = b.getPropertiesFieldNames().indexOf(field); if (index > -1) { final Boolean isTyped = b.getTypedPropertyFields().get(index); return isTyped ? Optional.ofNullable(getFieldValue(pojo, field)) : Optional.of(new DefinitionBindableProperty<>(pojo, field)); } else { return Optional.empty(); } } private  BindableDefinitionAdapterImpl(StunnerTranslationService translationService,
                                          BindableAdapterFunctions functions,
                                          Map<Class<?>, DefinitionAdapterBindings> bindings); static BindableDefinitionAdapterImpl<Object> create(StunnerTranslationService translationService,
                                                               BindableAdapterFunctions functions); static BindableDefinitionAdapterImpl<Object> create(StunnerTranslationService translationService,
                                                               BindableAdapterFunctions functions,
                                                               Map<Class<?>, DefinitionAdapterBindings> bindings); @Override void addBindings(Class<?> type, DefinitionAdapterBindings bindings); @Override DefinitionId getId(T pojo); @Override String getCategory(T pojo); @Override String getTitle(T pojo); @Override String getDescription(T pojo); @Override @SuppressWarnings("all") String[] getLabels(T pojo); @Override String[] getPropertyFields(T pojo); @Override Optional<?> getProperty(T pojo, String field); @Override String getMetaPropertyField(T pojo, PropertyMetaTypes type); @Override String getBaseType(Class<?> type); @Override String[] getTypes(String baseType); @Override Class<? extends ElementFactory> getGraphFactoryType(T pojo); @Override @SuppressWarnings("all") Class<? extends ElementFactory> getGraphFactory(Class<?> type); @Override boolean accepts(Class<?> type); @Override int getPriority();  }### Answer:
@Test @SuppressWarnings("all") public void testGetNameProperty() { Optional<?> nameValue = tested.getProperty(BEAN1, "nameField"); assertTrue(nameValue.isPresent()); DefinitionBindableProperty name = (DefinitionBindableProperty) nameValue.get(); assertEquals(BEAN1, name.getPojo()); assertEquals("nameField", name.getField()); }
@Test @SuppressWarnings("all") public void testGetNonexistentProperty() { Optional<?> nameValue = tested.getProperty(BEAN1, "someField"); assertFalse(nameValue.isPresent()); }
@Test @SuppressWarnings("all") public void testGetStringProperty() { Optional<?> stringField = tested.getProperty(BEAN1, "stringField"); assertTrue(stringField.isPresent()); DefinitionBindableProperty s = (DefinitionBindableProperty) stringField.get(); assertEquals(BEAN1, s.getPojo()); assertEquals("stringField", s.getField()); }
@Test public void testGetTypedProperty() { BindableTestProperty1 property = new BindableTestProperty1(); when(functions.getValue(eq(BEAN1), eq("propertyField"))).thenReturn(property); Optional<?> propertyField = tested.getProperty(BEAN1, "propertyField"); assertTrue(propertyField.isPresent()); assertEquals(property, propertyField.get()); }