import java.util.Date;
import org.hamcrest.CoreMatchers;
import org.junit.Assert;
import com.google.common.base.Objects;/*** TODO 在此写上类的相关说明.<br>* @author gqltt<br>* @version 1.0.0 2021年11月11日<br>* @see * @since JDK 1.5.0*/
public class ObjectsDemo {/*** @param args*/public static void main(String[] args) {equal();hashCodes();}/*** 允许null值的比较相等性.*/static void equal() {boolean result = Objects.equal(null, "abc");Assert.assertThat(result, CoreMatchers.is(false));}/*** 多对象计算hashcode.*/static void hashCodes() {int result = Objects.hashCode(12, "abc", new Date());System.out.println(result);}
}