### Question:
DefProConfiguration implements Configuration { @Override public boolean exists(Property<?> property) { try { return api.getStringValueOf(property.getKey()) != null; } catch (NotExistingVariableException ignored) { return false; } } DefProConfiguration(IDefProAPI api); @Override @SuppressWarnings("unchecked") T get(Property<T> property, T defaultValue); @Override boolean exists(Property<?> property);  }### Answer:
@Test public void propertyExists() throws Exception { when(api.getStringValueOf("test")).thenReturn(""); assertThat(config.exists(new StringProperty("test", ""))).isTrue(); }
@Test public void propertyNotExists() throws Exception { when(api.getStringValueOf(anyString())).thenThrow(new NotExistingVariableException("")); assertThat(config.exists(new StringProperty("test", ""))).isFalse(); }
@Test public void propertyNullNotExists() throws Exception { when(api.getStringValueOf(anyString())).thenReturn(null); assertThat(config.exists(new StringProperty("test", ""))).isFalse(); }