Java Assert assertSameObject(Object obj1, Object obj2)

Here you can find the source of assertSameObject(Object obj1, Object obj2)

Description

Checks object memory equality

License

Open Source License

Declaration

public static void assertSameObject(Object obj1, Object obj2) 

Method Source Code

//package com.java2s;
/**//from   w ww  .  jav  a  2  s  .  c om
 * <copyright>
 *
 * Copyright (c) 2005, 2006, 2007, 2008 Springsite BV (The Netherlands) and others
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *   Martin Taal - Initial API and implementation
 *
 * </copyright>
 *
 * $Id: AssertUtil.java,v 1.7 2009/03/30 07:53:04 mtaal Exp $
 */

public class Main {
    /** Checks object memory equality */
    public static void assertSameObject(Object obj1, Object obj2) {
        if (obj1 != obj2) {
            throw new AssertionError("Objects are not the same");
        }
    }
}

Related

  1. assertRange(String label, double value, double min, double max)
  2. assertRequiredArgs(Object[] methodArgs, int requiredArgs, String methodName)
  3. assertSame(Object expected, Object actual)
  4. assertSame(Object targetObject0, Object targetObject1)
  5. assertSameClazz(Object object, Object defaults)
  6. assertSameSize(double[][] newLogPhi, double[][] logPhi)
  7. assertSorted(final int[] values)
  8. assertSplit(final String text, final int length)
  9. assertSquare(double[]... d)