Text implements CharSequence { @Override public String toString() { return new String(chars, pos, len).trim(); } Text(); protected  Text(Text another);  Text(String s);  Text(int i);  Text(byte[] data, int pos, int len); void strain(byte[] data, int pos, int len); int length(); char charAt(int index); void copy(Text destination); void duplicate(Text destination); int divide(char separator, Text[] parts); int divide(char[] separators, Text[] parts); CharSequence subSequence(int start, int end); Text subtext(int start, int end); Text subtext(int start); Collection<Text> split(char separator); Collection<Text> split(Text separator); int indexOf(Text value); int indexOf(char value); void trim(); Text nextLine(); boolean hasMoreLines(); @Override boolean equals(Object other); @Override int hashCode(); boolean startsWith(Text pattern); @Override String toString(); int toInteger(); long toLong(); int hexToInteger(); void write(ByteBuffer buffer); void copyRemainder(Text other); boolean contains(char c);  }
@Test public void testConstructorWithInteger() { long s = System.nanoTime(); Text t = new Text(123); long f = System.nanoTime(); System.out.println("==== Duration=" + (f-s)); assertEquals("123", t.toString()); s = System.nanoTime(); t = new Text(1234); f = System.nanoTime(); System.out.println("==== Duration=" + (f-s)); assertEquals("1234", t.toString()); s = System.nanoTime(); String ss = Integer.toString(123); f = System.nanoTime(); System.out.println("==== Duration=" + (f-s)); }
@Test public void testIntegerConstructor() { Text t = new Text(10); System.out.println(t.toString()); assertEquals("10", t.toString()); }