GAVPreferences implements BasePreference<GAVPreferences> { @Override public GAVPreferences defaultValue(final GAVPreferences defaultValue) { final String conflictingGAVCheckDisabledSystemProperty = System.getProperty("org.guvnor.project.gav.check.disabled", "false"); final boolean conflictingGAVCheckDisabled = Boolean.parseBoolean(conflictingGAVCheckDisabledSystemProperty); defaultValue.setConflictingGAVCheckDisabled(conflictingGAVCheckDisabled); final String childGAVEditEnabledSystemProperty = System.getProperty("org.guvnor.project.gav.child.edit.enabled", "false"); final boolean childGAVEditEnabled = Boolean.parseBoolean(childGAVEditEnabledSystemProperty); defaultValue.setChildGAVEditEnabled(childGAVEditEnabled); return defaultValue; }  @Override GAVPreferences defaultValue(final GAVPreferences defaultValue); boolean isConflictingGAVCheckDisabled(); void setConflictingGAVCheckDisabled(final boolean conflictingGAVCheckDisabled); boolean isChildGAVEditEnabled(); void setChildGAVEditEnabled(final boolean childGAVEditEnabled);  }
@Test public void defaultValueTest() { GAVPreferences gavPreferences = new GAVPreferences(); gavPreferences.defaultValue(gavPreferences); assertFalse(gavPreferences.isChildGAVEditEnabled()); assertFalse(gavPreferences.isConflictingGAVCheckDisabled()); System.setProperty(GAVPreferences.CONFLICTING_GAV_CHECK_DISABLED, "true"); System.setProperty(GAVPreferences.CHILD_GAV_EDIT_ENABLED, "true"); gavPreferences.defaultValue(gavPreferences); assertTrue(gavPreferences.isChildGAVEditEnabled()); assertTrue(gavPreferences.isConflictingGAVCheckDisabled()); }