FileDocCategorySizeDatePackage
StringTest.javaAPI DocAndroid 1.5 API33113Wed May 06 22:42:02 BST 2009com.android.unit_tests

StringTest

public class StringTest extends android.test.PerformanceTestBase

Fields Summary
public static final int
ITERATIONS
public static final String
STATIC_STRING_01
public static final String
STATIC_STRING_02
public static final char[]
STATIC_CHAR_ARRAY
public static StringBuffer
STATIC_SBUF
Constructors Summary
Methods Summary
public voidStringtoLowerCase()
toLowerCase*

        String rString, str = STATIC_STRING_02;
        for (int i = ITERATIONS - 1; i >= 0; i--) {
            rString = str.toLowerCase();
            rString = str.toLowerCase();
            rString = str.toLowerCase();
            rString = str.toLowerCase();
            rString = str.toLowerCase();
            rString = str.toLowerCase();
            rString = str.toLowerCase();
            rString = str.toLowerCase();
            rString = str.toLowerCase();
            rString = str.toLowerCase();
        }
    
public intstartPerformance(PerformanceTestCase.Intermediates intermediates)


    
        
        intermediates.setInternalIterations(ITERATIONS);
        return 0;
    
public voidtestStringBufferAppend()

        StringBuffer sBuf = new StringBuffer(" ");
        for (int i = ITERATIONS - 1; i >= 0; i--) {
            sBuf.append(i);
            sBuf.append(i);
            sBuf.append(i);
            sBuf.append(i);
            sBuf.append(i);
            sBuf.append(i);
            sBuf.append(i);
            sBuf.append(i);
            sBuf.append(i);
            sBuf.append(i);
        }
    
public voidtestStringBufferIndexOf()

        StringBuffer sBuf = STATIC_SBUF;
        String str = "t";
        int index;
        for (int i = ITERATIONS - 1; i >= 0; i--) {
            index = sBuf.indexOf(str);
            index = sBuf.indexOf(str);
            index = sBuf.indexOf(str);
            index = sBuf.indexOf(str);
            index = sBuf.indexOf(str);
            index = sBuf.indexOf(str);
            index = sBuf.indexOf(str);
            index = sBuf.indexOf(str);
            index = sBuf.indexOf(str);
            index = sBuf.indexOf(str);
        }
    
public voidtestStringBufferIndexOf1()

        StringBuffer sBuf = STATIC_SBUF;
        String str = "tom";
        int index, pos = 12;
        for (int i = ITERATIONS - 1; i >= 0; i--) {
            index = sBuf.indexOf(str, pos);
            index = sBuf.indexOf(str, pos);
            index = sBuf.indexOf(str, pos);
            index = sBuf.indexOf(str, pos);
            index = sBuf.indexOf(str, pos);
            index = sBuf.indexOf(str, pos);
            index = sBuf.indexOf(str, pos);
            index = sBuf.indexOf(str, pos);
            index = sBuf.indexOf(str, pos);
            index = sBuf.indexOf(str, pos);
        }

    
public voidtestStringBufferInsert()

        StringBuffer sBuf = new StringBuffer(" ");
        int index = sBuf.length();
        for (int i = ITERATIONS - 1; i >= 0; i--) {
            sBuf.insert(index, i);
            sBuf.insert(index, i);
            sBuf.insert(index, i);
            sBuf.insert(index, i);
            sBuf.insert(index, i);
            sBuf.insert(index, i);
            sBuf.insert(index, i);
            sBuf.insert(index, i);
            sBuf.insert(index, i);
            sBuf.insert(index, i);
        }
    
public voidtestStringBufferLastIndexOf()

        StringBuffer sBuf = STATIC_SBUF;
        String str = "t";
        int index;
        for (int i = ITERATIONS - 1; i >= 0; i--) {
            index = sBuf.lastIndexOf(str);
            index = sBuf.lastIndexOf(str);
            index = sBuf.lastIndexOf(str);
            index = sBuf.lastIndexOf(str);
            index = sBuf.lastIndexOf(str);
            index = sBuf.lastIndexOf(str);
            index = sBuf.lastIndexOf(str);
            index = sBuf.lastIndexOf(str);
            index = sBuf.lastIndexOf(str);
            index = sBuf.lastIndexOf(str);
        }
    
public voidtestStringBufferLastIndexOf1()

        StringBuffer sBuf = STATIC_SBUF;
        int index, pos = 36;
        String str = "tom";
        for (int i = ITERATIONS - 1; i >= 0; i--) {
            index = sBuf.lastIndexOf(str, pos);
            index = sBuf.lastIndexOf(str, pos);
            index = sBuf.lastIndexOf(str, pos);
            index = sBuf.lastIndexOf(str, pos);
            index = sBuf.lastIndexOf(str, pos);
            index = sBuf.lastIndexOf(str, pos);
            index = sBuf.lastIndexOf(str, pos);
            index = sBuf.lastIndexOf(str, pos);
            index = sBuf.lastIndexOf(str, pos);
            index = sBuf.lastIndexOf(str, pos);
        }
    
public voidtestStringBufferReplace()

        StringBuffer sBuf = STATIC_SBUF;
        int start = 3, end = 6;
        String str = "ind";
        for (int i = ITERATIONS - 1; i >= 0; i--) {
            sBuf.replace(start, end, str);
            sBuf.replace(start, end, str);
            sBuf.replace(start, end, str);
            sBuf.replace(start, end, str);
            sBuf.replace(start, end, str);
            sBuf.replace(start, end, str);
            sBuf.replace(start, end, str);
            sBuf.replace(start, end, str);
            sBuf.replace(start, end, str);
            sBuf.replace(start, end, str);
        }
    
public voidtestStringBufferReverse()

        StringBuffer sBuf = STATIC_SBUF;
        for (int i = ITERATIONS - 1; i >= 0; i--) {
            sBuf.reverse();
            sBuf.reverse();
            sBuf.reverse();
            sBuf.reverse();
            sBuf.reverse();
            sBuf.reverse();
            sBuf.reverse();
            sBuf.reverse();
            sBuf.reverse();
            sBuf.reverse();
        }
    
public voidtestStringBufferSubstring()

        StringBuffer sBuf = STATIC_SBUF;
        String rString;
        int index = 0;
        for (int i = ITERATIONS - 1; i >= 0; i--) {
            rString = sBuf.substring(index);
            rString = sBuf.substring(index);
            rString = sBuf.substring(index);
            rString = sBuf.substring(index);
            rString = sBuf.substring(index);
            rString = sBuf.substring(index);
            rString = sBuf.substring(index);
            rString = sBuf.substring(index);
            rString = sBuf.substring(index);
            rString = sBuf.substring(index);
        }
    
public voidtestStringBufferSubstring1()

        StringBuffer sBuf = STATIC_SBUF;
        String rString;
        int start = 5, end = 25;
        for (int i = ITERATIONS - 1; i >= 0; i--) {
            rString = sBuf.substring(start, end);
            rString = sBuf.substring(start, end);
            rString = sBuf.substring(start, end);
            rString = sBuf.substring(start, end);
            rString = sBuf.substring(start, end);
            rString = sBuf.substring(start, end);
            rString = sBuf.substring(start, end);
            rString = sBuf.substring(start, end);
            rString = sBuf.substring(start, end);
            rString = sBuf.substring(start, end);
        }
    
public voidtestStringCompareTo()
Compare string objects lexicographically using compareTo() with for loop*

        String str1 = new String(STATIC_STRING_01);
        String str2 = STATIC_STRING_01;
        int result;
        for (int i = ITERATIONS - 1; i >= 0; i--) {
            result = str1.compareTo(str2);
            result = str1.compareTo(str2);
            result = str1.compareTo(str2);
            result = str1.compareTo(str2);
            result = str1.compareTo(str2);
            result = str1.compareTo(str2);
            result = str1.compareTo(str2);
            result = str1.compareTo(str2);
            result = str1.compareTo(str2);
            result = str1.compareTo(str2);
        }

    
public voidtestStringCompareToIgnoreCase()
Compare string objects using compareToIgnorecase() with for loop*

        String mString = new String(STATIC_STRING_01);
        String str2 = STATIC_STRING_01;
        int result;
        for (int i = ITERATIONS - 1; i >= 0; i--) {
            result = mString.compareToIgnoreCase(str2);
            result = mString.compareToIgnoreCase(str2);
            result = mString.compareToIgnoreCase(str2);
            result = mString.compareToIgnoreCase(str2);
            result = mString.compareToIgnoreCase(str2);
            result = mString.compareToIgnoreCase(str2);
            result = mString.compareToIgnoreCase(str2);
            result = mString.compareToIgnoreCase(str2);
            result = mString.compareToIgnoreCase(str2);
            result = mString.compareToIgnoreCase(str2);
        }
    
public voidtestStringConcat()

        String mString, str1 = STATIC_STRING_01, str2 = STATIC_STRING_02;
        for (int i = ITERATIONS - 1; i >= 0; i--) {
            mString = str1.concat(str2);
            mString = str1.concat(str2);
            mString = str1.concat(str2);
            mString = str1.concat(str2);
            mString = str1.concat(str2);
            mString = str1.concat(str2);
            mString = str1.concat(str2);
            mString = str1.concat(str2);
            mString = str1.concat(str2);
            mString = str1.concat(str2);
        }
    
public voidtestStringContentEquals()
ContentEquals- Comparing the content of a String with that of a String Buffer*

        StringBuffer sBuf = new StringBuffer(STATIC_STRING_01);
        String str = STATIC_STRING_01;
        boolean result;
        for (int i = ITERATIONS - 1; i >= 0; i--) {
            result = str.contentEquals(sBuf);
            result = str.contentEquals(sBuf);
            result = str.contentEquals(sBuf);
            result = str.contentEquals(sBuf);
            result = str.contentEquals(sBuf);
            result = str.contentEquals(sBuf);
            result = str.contentEquals(sBuf);
            result = str.contentEquals(sBuf);
            result = str.contentEquals(sBuf);
            result = str.contentEquals(sBuf);
        }
    
public voidtestStringCreate()
Create an empty String object*

        String rString;
        for (int i = ITERATIONS - 1; i >= 0; i--) {
            rString = new String();
            rString = new String();
            rString = new String();
            rString = new String();
            rString = new String();
            rString = new String();
            rString = new String();
            rString = new String();
            rString = new String();
            rString = new String();
        }
    
public voidtestStringCreate1()
Create an initialised String object*

        String rString, str = STATIC_STRING_01;
        for (int i = ITERATIONS - 1; i >= 0; i--) {
            rString = new String(str);
            rString = new String(str);
            rString = new String(str);
            rString = new String(str);
            rString = new String(str);
            rString = new String(str);
            rString = new String(str);
            rString = new String(str);
            rString = new String(str);
            rString = new String(str); // 10
        }
    
public voidtestStringEquals()
equals() with for loop*

        String mString = new String(STATIC_STRING_01);
        String str = STATIC_STRING_01;
        boolean result;
        for (int i = ITERATIONS - 1; i >= 0; i--) {
            result = mString.equals(str);
            result = mString.equals(str);
            result = mString.equals(str);
            result = mString.equals(str);
            result = mString.equals(str);
            result = mString.equals(str);
            result = mString.equals(str);
            result = mString.equals(str);
            result = mString.equals(str);
            result = mString.equals(str);
        }
    
public voidtestStringcharAt()
charAt()*

        String str = STATIC_STRING_02;
        int index, pos = 21;
        for (int i = ITERATIONS - 1; i >= 0; i--) {
            index = str.charAt(pos);
            index = str.charAt(pos);
            index = str.charAt(pos);
            index = str.charAt(pos);
            index = str.charAt(pos);
            index = str.charAt(pos);
            index = str.charAt(pos);
            index = str.charAt(pos);
            index = str.charAt(pos);
            index = str.charAt(pos);
        }
    
public voidtestStringcontains()
contains() to determine whether a string contains a substring

        boolean result;
        String str = STATIC_STRING_02, str1 = "tomo";
        for (int i = ITERATIONS - 1; i >= 0; i--) {
            result = str.contains(str1);
            result = str.contains(str1);
            result = str.contains(str1);
            result = str.contains(str1);
            result = str.contains(str1);
            result = str.contains(str1);
            result = str.contains(str1);
            result = str.contains(str1);
            result = str.contains(str1);
            result = str.contains(str1);
        }
    
public voidtestStringcopyValueOf()
copyValueOf(char[] data) *

        String rString;
        char[] cArray = STATIC_CHAR_ARRAY;
        for (int i = ITERATIONS - 1; i >= 0; i--) {
            rString = String.copyValueOf(cArray);
            rString = String.copyValueOf(cArray);
            rString = String.copyValueOf(cArray);
            rString = String.copyValueOf(cArray);
            rString = String.copyValueOf(cArray);
            rString = String.copyValueOf(cArray);
            rString = String.copyValueOf(cArray);
            rString = String.copyValueOf(cArray);
            rString = String.copyValueOf(cArray);
            rString = String.copyValueOf(cArray);
        }
    
public voidtestStringcopyValueOf1()
copyValueOf(char[] data, int index, int count)*

        String rString;
        int start = 1, end = 7;
        char[] cArray = STATIC_CHAR_ARRAY;
        for (int i = ITERATIONS - 1; i >= 0; i--) {
            rString = String.copyValueOf(cArray, start, end);
            rString = String.copyValueOf(cArray, start, end);
            rString = String.copyValueOf(cArray, start, end);
            rString = String.copyValueOf(cArray, start, end);
            rString = String.copyValueOf(cArray, start, end);
            rString = String.copyValueOf(cArray, start, end);
            rString = String.copyValueOf(cArray, start, end);
            rString = String.copyValueOf(cArray, start, end);
            rString = String.copyValueOf(cArray, start, end);
            rString = String.copyValueOf(cArray, start, end);
        }
    
public voidtestStringendsWith()
endsWith *

        String str = STATIC_STRING_02, str1 = "day";
        boolean result;
        for (int i = ITERATIONS - 1; i >= 0; i--) {
            result = str.endsWith(str1);
            result = str.endsWith(str1);
            result = str.endsWith(str1);
            result = str.endsWith(str1);
            result = str.endsWith(str1);
            result = str.endsWith(str1);
            result = str.endsWith(str1);
            result = str.endsWith(str1);
            result = str.endsWith(str1);
            result = str.endsWith(str1);
        }
    
public voidtestStringgetBytes()

        byte[] bytes;
        String str = STATIC_STRING_02;
        for (int i = ITERATIONS - 1; i >= 0; i--) {
            bytes = str.getBytes();
            bytes = str.getBytes();
            bytes = str.getBytes();
            bytes = str.getBytes();
            bytes = str.getBytes();
            bytes = str.getBytes();
            bytes = str.getBytes();
            bytes = str.getBytes();
            bytes = str.getBytes();
            bytes = str.getBytes();
        }
    
public voidtestStringgetChars()
getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)*

        char[] cArray = STATIC_CHAR_ARRAY;
        String str = STATIC_STRING_01;
        int value1 = 7, value2 = 12, value3 = 1;
        for (int i = ITERATIONS - 1; i >= 0; i--) {
            str.getChars(value1, value2, cArray, value3);
            str.getChars(value1, value2, cArray, value3);
            str.getChars(value1, value2, cArray, value3);
            str.getChars(value1, value2, cArray, value3);
            str.getChars(value1, value2, cArray, value3);
            str.getChars(value1, value2, cArray, value3);
            str.getChars(value1, value2, cArray, value3);
            str.getChars(value1, value2, cArray, value3);
            str.getChars(value1, value2, cArray, value3);
            str.getChars(value1, value2, cArray, value3);
        }
    
public voidtestStringhashCode()
hashcode()*

        int index;
        String str = STATIC_STRING_02;
        for (int i = ITERATIONS - 1; i >= 0; i--) {
            index = str.hashCode();
            index = str.hashCode();
            index = str.hashCode();
            index = str.hashCode();
            index = str.hashCode();
            index = str.hashCode();
            index = str.hashCode();
            index = str.hashCode();
            index = str.hashCode();
            index = str.hashCode();
        }
    
public voidtestStringindexOf()
indexOf to determine whether a string contains a substring

        boolean result;
        String str = STATIC_STRING_02, str1 = "tomo";
        for (int i = ITERATIONS - 1; i >= 0; i--) {
            result = str.indexOf(str1) > 0;
            result = str.indexOf(str1) > 0;
            result = str.indexOf(str1) > 0;
            result = str.indexOf(str1) > 0;
            result = str.indexOf(str1) > 0;
            result = str.indexOf(str1) > 0;
            result = str.indexOf(str1) > 0;
            result = str.indexOf(str1) > 0;
            result = str.indexOf(str1) > 0;
            result = str.indexOf(str1) > 0;
        }
    
public voidtestStringindexOf1()
indexOf()*

        int index;
        String str = STATIC_STRING_02;
        char c = 't";
        for (int i = ITERATIONS - 1; i >= 0; i--) {
            index = str.indexOf(c);
            index = str.indexOf(c);
            index = str.indexOf(c);
            index = str.indexOf(c);
            index = str.indexOf(c);
            index = str.indexOf(c);
            index = str.indexOf(c);
            index = str.indexOf(c);
            index = str.indexOf(c);
            index = str.indexOf(c);
        }

    
public voidtestStringindexOf2()
indexOf(char c, int start)*

        int index, pos = 12;
        String str = STATIC_STRING_02, str1 = "tom";
        for (int i = ITERATIONS - 1; i >= 0; i--) {
            index = str.indexOf(str1, pos);
            index = str.indexOf(str1, pos);
            index = str.indexOf(str1, pos);
            index = str.indexOf(str1, pos);
            index = str.indexOf(str1, pos);
            index = str.indexOf(str1, pos);
            index = str.indexOf(str1, pos);
            index = str.indexOf(str1, pos);
            index = str.indexOf(str1, pos);
            index = str.indexOf(str1, pos);
        }
    
public voidtestStringlastIndexOf()
lastIndexOf()*

        int index;
        char c = 't";
        String str = STATIC_STRING_02;
        for (int i = ITERATIONS - 1; i >= 0; i--) {
            index = str.lastIndexOf(c);
            index = str.lastIndexOf(c);
            index = str.lastIndexOf(c);
            index = str.lastIndexOf(c);
            index = str.lastIndexOf(c);
            index = str.lastIndexOf(c);
            index = str.lastIndexOf(c);
            index = str.lastIndexOf(c);
            index = str.lastIndexOf(c);
            index = str.lastIndexOf(c);
        }
    
public voidtestStringlastIndexOf1()
lastIndexOf()*

        int index, pos = 36;
        String str = STATIC_STRING_02, str1 = "tom";
        for (int i = ITERATIONS - 1; i >= 0; i--) {
            index = str.lastIndexOf(str1, pos);
            index = str.lastIndexOf(str1, pos);
            index = str.lastIndexOf(str1, pos);
            index = str.lastIndexOf(str1, pos);
            index = str.lastIndexOf(str1, pos);
            index = str.lastIndexOf(str1, pos);
            index = str.lastIndexOf(str1, pos);
            index = str.lastIndexOf(str1, pos);
            index = str.lastIndexOf(str1, pos);
            index = str.lastIndexOf(str1, pos);
        }
    
public voidtestStringlength()
length()*

        int len;
        String str = STATIC_STRING_02;
        for (int i = ITERATIONS - 1; i >= 0; i--) {
            len = str.length();
            len = str.length();
            len = str.length();
            len = str.length();
            len = str.length();
            len = str.length();
            len = str.length();
            len = str.length();
            len = str.length();
            len = str.length();
        }
    
public voidtestStringreplace()
replace()*

        String rString;
        String str = STATIC_STRING_02;
        char c1 = ' ", c2 = ' ";
        for (int i = ITERATIONS - 1; i >= 0; i--) {
            rString = str.replace(c1, c2);
            rString = str.replace(c1, c2);
            rString = str.replace(c1, c2);
            rString = str.replace(c1, c2);
            rString = str.replace(c1, c2);
            rString = str.replace(c1, c2);
            rString = str.replace(c1, c2);
            rString = str.replace(c1, c2);
            rString = str.replace(c1, c2);
            rString = str.replace(c1, c2);
        }
    
public voidtestStringreplaceAll()

        String rString;
        String str = STATIC_STRING_02, str1 = " ", str2 = "/";
        for (int i = ITERATIONS - 1; i >= 0; i--) {
            rString = str.replaceAll(str1, str2);
            rString = str.replaceAll(str1, str2);
            rString = str.replaceAll(str1, str2);
            rString = str.replaceAll(str1, str2);
            rString = str.replaceAll(str1, str2);
            rString = str.replaceAll(str1, str2);
            rString = str.replaceAll(str1, str2);
            rString = str.replaceAll(str1, str2);
            rString = str.replaceAll(str1, str2);
            rString = str.replaceAll(str1, str2);
        }
    
public voidtestStringsplit()
Split a string into an array of strings*

        String[] strings;
        String str1 = STATIC_STRING_02, str = " ";
        for (int i = ITERATIONS - 1; i >= 0; i--) {
            strings = str1.split(str);
            strings = str1.split(str);
            strings = str1.split(str);
            strings = str1.split(str);
            strings = str1.split(str);
            strings = str1.split(str);
            strings = str1.split(str);
            strings = str1.split(str);
            strings = str1.split(str);
            strings = str1.split(str);

        }
    
public voidtestStringsplit1()
Split a string into an array of strings*

        String str = STATIC_STRING_02, str1 = " ";
        String[] strings;
        int pos = 8;
        for (int i = ITERATIONS - 1; i >= 0; i--) {
            strings = str.split(str1, pos);
            strings = str.split(str1, pos);
            strings = str.split(str1, pos);
            strings = str.split(str1, pos);
            strings = str.split(str1, pos);
            strings = str.split(str1, pos);
            strings = str.split(str1, pos);
            strings = str.split(str1, pos);
            strings = str.split(str1, pos);
            strings = str.split(str1, pos);
        }
    
public voidtestStringstartsWith()
startsWith *

        boolean result;
        String str1 = STATIC_STRING_02, str2 = "Rem";
        for (int i = ITERATIONS - 1; i >= 0; i--) {
            result = str1.startsWith(str2);
            result = str1.startsWith(str2);
            result = str1.startsWith(str2);
            result = str1.startsWith(str2);
            result = str1.startsWith(str2);
            result = str1.startsWith(str2);
            result = str1.startsWith(str2);
            result = str1.startsWith(str2);
            result = str1.startsWith(str2);
            result = str1.startsWith(str2);
        }
    
public voidtestStringstartsWith1()
startsWith(String seq, int begin) *

        String str1 = STATIC_STRING_02, str2 = "tom";
        int pos = 10;
        boolean result;
        for (int i = ITERATIONS - 1; i >= 0; i--) {
            result = str1.startsWith(str2, pos);
            result = str1.startsWith(str2, pos);
            result = str1.startsWith(str2, pos);
            result = str1.startsWith(str2, pos);
            result = str1.startsWith(str2, pos);
            result = str1.startsWith(str2, pos);
            result = str1.startsWith(str2, pos);
            result = str1.startsWith(str2, pos);
            result = str1.startsWith(str2, pos);
            result = str1.startsWith(str2, pos);
        }
    
public voidtestStringsubstring()
substring(int start)

        String rString;
        String str = STATIC_STRING_02;
        int index = 10;
        for (int i = ITERATIONS - 1; i >= 0; i--) {
            rString = str.substring(index);
            rString = str.substring(index);
            rString = str.substring(index);
            rString = str.substring(index);
            rString = str.substring(index);
            rString = str.substring(index);
            rString = str.substring(index);
            rString = str.substring(index);
            rString = str.substring(index);
            rString = str.substring(index);
        }
    
public voidtestStringsubstring1()
substring(int start, int end) in a for loop*

        String rString;
        String str = STATIC_STRING_02;
        int start = 10, end = 48;
        for (int i = ITERATIONS - 1; i >= 0; i--) {
            rString = str.substring(start, end);
            rString = str.substring(start, end);
            rString = str.substring(start, end);
            rString = str.substring(start, end);
            rString = str.substring(start, end);
            rString = str.substring(start, end);
            rString = str.substring(start, end);
            rString = str.substring(start, end);
            rString = str.substring(start, end);
            rString = str.substring(start, end);
        }
    
public voidtestStringtoCharArray()
Convert a string to a char Array*

        char[] cArray;
        String str = STATIC_STRING_02;
        for (int i = ITERATIONS - 1; i >= 0; i--) {
            cArray = str.toCharArray();
            cArray = str.toCharArray();
            cArray = str.toCharArray();
            cArray = str.toCharArray();
            cArray = str.toCharArray();
            cArray = str.toCharArray();
            cArray = str.toCharArray();
            cArray = str.toCharArray();
            cArray = str.toCharArray();
            cArray = str.toCharArray();
        }
    
public voidtestStringtoLowerCase1()
toLowerCase with locale*

        Locale locale = new Locale("tr");
        String rString, str = STATIC_STRING_02;
        for (int i = ITERATIONS - 1; i >= 0; i--) {
            rString = str.toLowerCase(locale);
            rString = str.toLowerCase(locale);
            rString = str.toLowerCase(locale);
            rString = str.toLowerCase(locale);
            rString = str.toLowerCase(locale);
            rString = str.toLowerCase(locale);
            rString = str.toLowerCase(locale);
            rString = str.toLowerCase(locale);
            rString = str.toLowerCase(locale);
            rString = str.toLowerCase(locale);
        }
    
public voidtestStringtoString()
Convert a StringBuffer to a String*

        StringBuffer sBuf = new StringBuffer(STATIC_STRING_02);

        String rString;
        for (int i = ITERATIONS - 1; i >= 0; i--) {
            rString = sBuf.toString();
            rString = sBuf.toString();
            rString = sBuf.toString();
            rString = sBuf.toString();
            rString = sBuf.toString();
            rString = sBuf.toString();
            rString = sBuf.toString();
            rString = sBuf.toString();
            rString = sBuf.toString();
            rString = sBuf.toString();
        }
    
public voidtestStringtoUpperCase()
toUpperCase()*

        String rString, str = STATIC_STRING_02;
        for (int i = ITERATIONS - 1; i >= 0; i--) {
            rString = str.toUpperCase();
            rString = str.toUpperCase();
            rString = str.toUpperCase();
            rString = str.toUpperCase();
            rString = str.toUpperCase();
            rString = str.toUpperCase();
            rString = str.toUpperCase();
            rString = str.toUpperCase();
            rString = str.toUpperCase();
            rString = str.toUpperCase();
        }
    
public voidtestStringtoUpperCase1()
toUpperCase() with locale*

        Locale locale = new Locale("tr");
        String str = STATIC_STRING_02;
        String rString;
        for (int i = ITERATIONS - 1; i >= 0; i--) {
            rString = str.toUpperCase(locale);
            rString = str.toUpperCase(locale);
            rString = str.toUpperCase(locale);
            rString = str.toUpperCase(locale);
            rString = str.toUpperCase(locale);
            rString = str.toUpperCase(locale);
            rString = str.toUpperCase(locale);
            rString = str.toUpperCase(locale);
            rString = str.toUpperCase(locale);
            rString = str.toUpperCase(locale);
        }
    
public voidtestStringtrim()
trim()*

        String mString =
                new String(
                        "                            HELLO ANDROID                                                ");
        String rString;
        for (int i = ITERATIONS - 1; i >= 0; i--) {
            rString = mString.trim();
            rString = mString.trim();
            rString = mString.trim();
            rString = mString.trim();
            rString = mString.trim();
            rString = mString.trim();
            rString = mString.trim();
            rString = mString.trim();
            rString = mString.trim();
            rString = mString.trim();
        }
    
public voidtestStringvalueOf()
valueOf(char[] cArray) String representation of a character array

        String rString;
        char[] cArray = STATIC_CHAR_ARRAY;
        for (int i = ITERATIONS - 1; i >= 0; i--) {
            rString = String.valueOf(cArray);
            rString = String.valueOf(cArray);
            rString = String.valueOf(cArray);
            rString = String.valueOf(cArray);
            rString = String.valueOf(cArray);
            rString = String.valueOf(cArray);
            rString = String.valueOf(cArray);
            rString = String.valueOf(cArray);
            rString = String.valueOf(cArray);
            rString = String.valueOf(cArray);
        }
    
public voidtestStringvalueOf1()
valueOf(char[] cArray, int offset, int count)*

        String rString;
        char[] cArray = STATIC_CHAR_ARRAY;
        int start = 1, end = 7;
        for (int i = ITERATIONS - 1; i >= 0; i--) {
            rString = String.valueOf(cArray, start, end);
            rString = String.valueOf(cArray, start, end);
            rString = String.valueOf(cArray, start, end);
            rString = String.valueOf(cArray, start, end);
            rString = String.valueOf(cArray, start, end);
            rString = String.valueOf(cArray, start, end);
            rString = String.valueOf(cArray, start, end);
            rString = String.valueOf(cArray, start, end);
            rString = String.valueOf(cArray, start, end);
            rString = String.valueOf(cArray, start, end);
        }