@Test public void whenInputIsNotOneOfPredefinedTrueValues_ThenShouldReturnBooleanFalseValue() { assertThat(booleanTypeConverter.convert("false")).isFalse(); assertThat(booleanTypeConverter.convert("0")).isFalse(); assertThat(booleanTypeConverter.convert("off")).isFalse(); assertThat(booleanTypeConverter.convert("no")).isFalse(); assertThat(booleanTypeConverter.convert("foo")).isFalse(); assertThat(booleanTypeConverter.convert("foobar")).isFalse(); }
@Override public Boolean convert(final String value) { return Boolean.parseBoolean(value) || "1".equals(value) || "on".equalsIgnoreCase(value) || "yes".equalsIgnoreCase(value); }
BooleanTypeConverter implements TypeConverter<String, Boolean> { @Override public Boolean convert(final String value) { return Boolean.parseBoolean(value) || "1".equals(value) || "on".equalsIgnoreCase(value) || "yes".equalsIgnoreCase(value); } }
BooleanTypeConverter implements TypeConverter<String, Boolean> { @Override public Boolean convert(final String value) { return Boolean.parseBoolean(value) || "1".equals(value) || "on".equalsIgnoreCase(value) || "yes".equalsIgnoreCase(value); }  }
BooleanTypeConverter implements TypeConverter<String, Boolean> { @Override public Boolean convert(final String value) { return Boolean.parseBoolean(value) || "1".equals(value) || "on".equalsIgnoreCase(value) || "yes".equalsIgnoreCase(value); }  @Override Boolean convert(final String value); }
BooleanTypeConverter implements TypeConverter<String, Boolean> { @Override public Boolean convert(final String value) { return Boolean.parseBoolean(value) || "1".equals(value) || "on".equalsIgnoreCase(value) || "yes".equalsIgnoreCase(value); }  @Override Boolean convert(final String value);  }