// Copyright (C) 2015 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

import org.junit.Assert;
import org.junit.Test;

public class FindPermutationInDocTest {
    private String[] given = {"snow", "is", "over"};
    private String[] docHaving = {"snow", "is", "over"};
    private String[] docHaving2 = {"snow", "snow", "is", "over"};
    private String[] docHaving3 = {"find", "snow", "is", "over"};
    private String[] docHaving4 = {"snow", "is", "over", "yes"};
    private String[] docHaving5 = {"see", "snow", "is", "over", "right"};

    @Test(timeout = 3000L, expected = Test.None.class)
    public void testHavePermutation() {
        Assert.assertTrue(FindPermutationInDoc.hasPermutationIn(given, docHaving));
        Assert.assertTrue(FindPermutationInDoc.hasPermutationIn(given, docHaving2));
        Assert.assertTrue(FindPermutationInDoc.hasPermutationIn(given, docHaving3));
        Assert.assertTrue(FindPermutationInDoc.hasPermutationIn(given, docHaving4));
        Assert.assertTrue(FindPermutationInDoc.hasPermutationIn(given, docHaving5));
    }
}

@@ -906,15 +906,8 @@
  = %7B
-%22find%22,
  %22sn
@@ -927,72 +927,14 @@
 ver%22
-%7D;%0A    private String%5B%5D docHaving4 = %7B%22snow%22, %22is%22, %22over%22, %22yes
+,%22over
 %22%7D;%0A
@@ -967,20 +967,18 @@
 ving
-5
+4
  = %7B%22
-see
+hi
 %22,
- 
 %22sno
@@ -1000,18 +1000,17 @@
 %22, %22
-right
+yes
 %22%7D;%0A%0A
+%0A
     
@@ -1443,93 +1443,8 @@
 ));%0A
-        Assert.assertTrue(FindPermutationInDoc.hasPermutationIn(given, docHaving5));%0A
     

update the test to make simple