if (length == size) {  } else if (length < size) {
if (length < size) {
    public void setLength(int length) {        if (length < 0) {            throw new StringIndexOutOfBoundsException(length);        }        if (length == size) {            // ok        } else if (length < size) {            size = length;        } else {            ensureCapacity(length);            int oldEnd = size;            int newEnd = length;            size = length;            for (int i = oldEnd; i < newEnd; i++) {                buffer[i] = '\0';            }        }    }