Java Assert assertIsPermutation(int[] perm)

Here you can find the source of assertIsPermutation(int[] perm)

Description

assert Is Permutation

License

Apache License

Declaration

public static void assertIsPermutation(int[] perm) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static void assertIsPermutation(int[] perm) {
        boolean hit[] = new boolean[perm.length];
        for (int i : perm) {
            assert !hit[i];
            hit[i] = true;/*from www.  j  av  a  2  s  .  c o m*/
        }
    }
}

Related

  1. assertionError(String message, Object... args)
  2. assertionError(String message, Throwable cause)
  3. assertIOThread(Thread t, boolean flag)
  4. assertIsClass(Class klazz)
  5. assertIsNotEmptyString(String string)
  6. assertIsPositive(int num, String fieldName)
  7. assertIsProb(double x)
  8. assertIsProbability(final double probability)
  9. assertIsProperlyQuoted(String header, String tag)