コード例 #1
0
 @Test
 public void testPermutation1() {
   final String string = "abc";
   final String[] list = StringFunctions.permutations(string);
   Assert.assertTrue(list[0].equals("abc"));
   Assert.assertTrue(list[5].equals("cba"));
 }
コード例 #2
0
 @Test
 public void testPermutation2() {
   final String string = "abcd";
   final String[] list = StringFunctions.permutations(string);
   Assert.assertTrue(list[0].equals("abcd"));
   Assert.assertTrue(list[5].equals("adcb"));
   Assert.assertTrue(list[11].equals("bdca"));
   Assert.assertTrue(list[17].equals("cdba"));
   Assert.assertTrue(list[23].equals("dcba"));
 }