Java Assert assertDifferentInstance(final Object o1, final Object o2)

Here you can find the source of assertDifferentInstance(final Object o1, final Object o2)

Description

assert Different Instance

License

Open Source License

Declaration

public static void assertDifferentInstance(final Object o1, final Object o2) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static void assertDifferentInstance(final Object o1, final Object o2) {
        if (o1 == o2) {
            throw new AssertionError("The compared objects are the same instance of a class");
        }//w  w  w  .  j a  v  a  2 s .c o  m
    }
}

Related

  1. assertCondition(boolean condition, String msg)
  2. assertContains(final String string, final String content)
  3. assertContains(String needle, String haystack)
  4. assertDescriptorName(String key)
  5. assertDidNotThrow(final Runnable r)
  6. assertDotted(String name)
  7. assertEntryCount(final long entryCount)
  8. assertEnvVarPresent(String envVarKey, String errorMessage)
  9. assertException(Runnable task, Class clazz)