@Test public void testSpaces() { assertEquals("", spaces(0)); assertEquals(" ", spaces(1)); assertEquals(" ", spaces(8)); }
public static String spaces(int length) { if (length < 0) { length = 0; } String s; if (length < spaces.length) { s = spaces[length]; if (s == null) { s = spaces[spaces.length - 1].substring(0, length).intern(); spaces[length] = s; } } else { char[] blancs = new char[length]; Arrays.fill(blancs, ' '); s = new String(blancs); } return s; }
Utilities { public static String spaces(int length) { if (length < 0) { length = 0; } String s; if (length < spaces.length) { s = spaces[length]; if (s == null) { s = spaces[spaces.length - 1].substring(0, length).intern(); spaces[length] = s; } } else { char[] blancs = new char[length]; Arrays.fill(blancs, ' '); s = new String(blancs); } return s; } }
Utilities { public static String spaces(int length) { if (length < 0) { length = 0; } String s; if (length < spaces.length) { s = spaces[length]; if (s == null) { s = spaces[spaces.length - 1].substring(0, length).intern(); spaces[length] = s; } } else { char[] blancs = new char[length]; Arrays.fill(blancs, ' '); s = new String(blancs); } return s; } private  Utilities(); }
Utilities { public static String spaces(int length) { if (length < 0) { length = 0; } String s; if (length < spaces.length) { s = spaces[length]; if (s == null) { s = spaces[spaces.length - 1].substring(0, length).intern(); spaces[length] = s; } } else { char[] blancs = new char[length]; Arrays.fill(blancs, ' '); s = new String(blancs); } return s; } private  Utilities(); static boolean equals(boolean o1, boolean o2); static boolean equals(char o1, char o2); static boolean equals(byte o1, byte o2); static boolean equals(short o1, short o2); static boolean equals(int o1, int o2); static boolean equals(long o1, long o2); static boolean equals(float o1, float o2); static boolean equals(double o1, double o2); static boolean equals(final Object object1, final Object object2); static boolean deepEquals(final Object object1, final Object object2); static int hash(boolean value, int seed); static int hash(char value, int seed); static int hash(int value, int seed); static int hash(long value, int seed); static int hash(float value, int seed); static int hash(double value, int seed); static int hash(Object value, int seed); static int deepHashCode(final Object object); static String deepToString(final Object object); @SuppressWarnings("unchecked") static Queue<E> emptyQueue(); static String spaces(int length); static void ensureNonNull(final String name, final Object object); }
Utilities { public static String spaces(int length) { if (length < 0) { length = 0; } String s; if (length < spaces.length) { s = spaces[length]; if (s == null) { s = spaces[spaces.length - 1].substring(0, length).intern(); spaces[length] = s; } } else { char[] blancs = new char[length]; Arrays.fill(blancs, ' '); s = new String(blancs); } return s; } private  Utilities(); static boolean equals(boolean o1, boolean o2); static boolean equals(char o1, char o2); static boolean equals(byte o1, byte o2); static boolean equals(short o1, short o2); static boolean equals(int o1, int o2); static boolean equals(long o1, long o2); static boolean equals(float o1, float o2); static boolean equals(double o1, double o2); static boolean equals(final Object object1, final Object object2); static boolean deepEquals(final Object object1, final Object object2); static int hash(boolean value, int seed); static int hash(char value, int seed); static int hash(int value, int seed); static int hash(long value, int seed); static int hash(float value, int seed); static int hash(double value, int seed); static int hash(Object value, int seed); static int deepHashCode(final Object object); static String deepToString(final Object object); @SuppressWarnings("unchecked") static Queue<E> emptyQueue(); static String spaces(int length); static void ensureNonNull(final String name, final Object object);  }