### Question:
BooleanConverter implements ParameterConverter<Boolean> { @Override public Boolean fromString(String value) { return value != null && TRUE.contains(value.toLowerCase()); } private  BooleanConverter(); @Override Boolean fromString(String value); @Override Class<Boolean> getType(); static final BooleanConverter INSTANCE; }### Answer:
@Test public void testYesNo() throws Exception { assertThat(converter.fromString("yes")).isTrue(); assertThat(converter.fromString("YeS")).isTrue(); assertThat(converter.fromString("no")).isFalse(); assertThat(converter.fromString("nO")).isFalse(); }
@Test public void testOnOff() throws Exception { assertThat(converter.fromString("on")).isTrue(); assertThat(converter.fromString("ON")).isTrue(); assertThat(converter.fromString("off")).isFalse(); assertThat(converter.fromString("oFf")).isFalse(); }
@Test public void testTrueFalse() throws Exception { assertThat(converter.fromString("true")).isTrue(); assertThat(converter.fromString("TruE")).isTrue(); assertThat(converter.fromString("fALse")).isFalse(); assertThat(converter.fromString("false")).isFalse(); }
@Test public void testNumbers() throws Exception { assertThat(converter.fromString("1")).isTrue(); assertThat(converter.fromString("2")).isFalse(); assertThat(converter.fromString("0")).isFalse(); }
@Test public void testWithNullAndEmptyString() throws Exception { assertThat(converter.fromString(null)).isFalse(); assertThat(converter.fromString("")).isFalse(); }
@Test public void testWithRandomString() throws Exception { assertThat(converter.fromString("aaaa")).isFalse(); assertThat(converter.fromString("welcome true")).isFalse(); assertThat(converter.fromString("true welcome")).isFalse(); }