Example usage for android.support.v4.util SimpleArrayMap equals

List of usage examples for android.support.v4.util SimpleArrayMap equals

Introduction

In this page you can find the example usage for android.support.v4.util SimpleArrayMap equals.

Prototype

public boolean equals(Object obj) 

Source Link

Usage

From source file:com.bmd.android.collection.example.EnhancedArrayMapTest.java

public void testEquals() {

    assertThat(mArray).isEqualTo(mArray);
    assertThat(mArray.equals(mArray)).isTrue();

    final EnhancedArrayMap<Integer, String> array = new EnhancedArrayMap<Integer, String>();

    for (int i = 0; i < 5; i++) {

        array.put(i, String.valueOf(i));
    }/*from w  ww . jav  a  2  s  . co m*/

    assertThat(mArray).isEqualTo(array);
    assertThat(array).isEqualTo(mArray);
    assertThat(mArray.equals(array)).isTrue();
    assertThat(array.equals(mArray)).isTrue();

    final SimpleArrayMap<Integer, String> simpleArray = new SimpleArrayMap<Integer, String>();

    for (int i = 0; i < 5; i++) {

        simpleArray.put(i, String.valueOf(i));
    }

    assertThat(mArray.equals(simpleArray)).isTrue();
    assertThat(simpleArray.equals(mArray)).isFalse();
}