ReverseStringSolution { static String reverseStringSimplest(String s) { if (s == null || s.length() <= 1) return s; return new StringBuilder(s).reverse().toString(); }    }
@Test public void solutionSimplest() { assertNull(ReverseStringSolution.reverseStringSimplest(null)); assertEquals("", ReverseStringSolution.reverseStringSimplest("")); assertEquals("a", ReverseStringSolution.reverseStringSimplest("a")); assertEquals("olleh", ReverseStringSolution.reverseStringSimplest("hello")); assertEquals("!dlrow", ReverseStringSolution.reverseStringSimplest("world!")); long b = System.currentTimeMillis(); int count = SUPPRESS_TEST_LIMITATION; while (count > 0) { count--; ReverseStringSolution.reverseStringSimplest("yuzhouwan.com"); } long e = System.currentTimeMillis(); System.out.println(e - b); }