private String toStringBoolean() {
    // Code was removed from this method as ValueBoolean
    // did not store length, so some parts could never be
    // called.
    String retval;
    if ( value == null ) {
      return null;
    }

    if ( isNull() ) {
      retval = Const.NULL_BOOLEAN;
    } else {
      retval = value.getBoolean() ? "true" : "false";
    }

    return retval;
  }
@Test
  public void testToStringBoolean() {
    String result = null;

    Value vs = new Value( "Name", Value.VALUE_TYPE_BOOLEAN );
    vs.setValue( true );
    result = vs.toString( true );
    assertEquals( "true", result );

    Value vs1 = new Value( "Name", Value.VALUE_TYPE_BOOLEAN );
    vs1.setValue( false );
    result = vs1.toString( true );
    assertEquals( "false", result );

    // set to "null"
    Value vs2 = new Value( "Name", Value.VALUE_TYPE_BOOLEAN );
    vs2.setValue( true );
    vs2.setNull();
    result = vs2.toString( true );
    assertEquals( "", result );

    // set to "null"
    Value vs3 = new Value( "Name", Value.VALUE_TYPE_BOOLEAN );
    vs3.setValue( false );
    vs3.setNull();
    result = vs3.toString( true );
    assertEquals( "", result );

    // set to length = 1 => get Y/N
    Value vs4 = new Value( "Name", Value.VALUE_TYPE_BOOLEAN );
    vs4.setValue( true );
    vs4.setLength( 1 );
    result = vs4.toString( true );
    assertEquals( "true", result );

    // set to length = 1 => get Y/N
    Value vs5 = new Value( "Name", Value.VALUE_TYPE_BOOLEAN );
    vs5.setValue( false );
    vs5.setLength( 1 );
    result = vs5.toString( true );
    assertEquals( "false", result );

    // set to length > 1 => get true/false
    Value vs6 = new Value( "Name", Value.VALUE_TYPE_BOOLEAN );
    vs6.setValue( true );
    vs6.setLength( 3 );
    result = vs6.toString( true );
    assertEquals( "true", result );

    // set to length > 1 => get true/false (+ truncation)
    Value vs7 = new Value( "Name", Value.VALUE_TYPE_BOOLEAN );
    vs7.setValue( false );
    vs7.setLength( 3 );
    result = vs7.toString( true );
    assertEquals( "false", result );
  }