Java Assert Equal assertEqualsAny(Object obj1, Object[] objects, String errMsg)

Here you can find the source of assertEqualsAny(Object obj1, Object[] objects, String errMsg)

Description

assert Equals Any

License

Open Source License

Declaration

public static void assertEqualsAny(Object obj1, Object[] objects, String errMsg) 

Method Source Code

//package com.java2s;

public class Main {

    public static void assertEqualsAny(Object obj1, Object[] objects, String errMsg) {

        if (null == objects) {

            throw new RuntimeException(errMsg);
        }/*from  ww w  . j  a v  a  2  s.  c  o m*/

        for (Object obj2 : objects) {

            if (obj1 == null) {

                if (obj2 == null) {
                    return;
                }

                continue;
            }

            if (obj1.equals(obj2)) {

                return;
            }
        }

        throw new RuntimeException(errMsg);
    }
}

Related

  1. assertEquals(Object val1, Object val2)
  2. assertEquals(String expected, String actual)
  3. assertEquals(String expected, String current)
  4. assertEquals(String message, Object expected, Object actual)
  5. assertEquals(T expected, T actual)
  6. assertEqualsToStringBuilder(final StringBuilder errorMessageHolder, final String currentEM, final Object expected, final Object actual)