Android compara imageView com imagem

Quero comparar o imageView atual com a imagem de R.drawable. Acho que tentei de tudo, mas não consigo resolver este. Eu tentei de tudo estouro de pilha de formulário.

XML:

<ImageView
        android:layout_width="match_parent"
        android:src="@drawable/red"
        android:id="@+id/imageview1"
        android:clickable="true"
        android:layout_height="match_parent" />

Android:

final ImageView test = (ImageView) findViewById(R.id.imageview1);

test.setOnClickListener(new View.OnClickListener() {
     @Override
     public void onClick(View v) {
          //if(test.getResources().equals(R.drawable.red))
          //if(test.getDrawable().equals(R.drawable.red))
          if(test.getDrawable().getConstantState().equals(getResources().getDrawable(R.drawable.red).getConstantState()))
          {
               Toast.makeText(getApplicationContext(), "work", Toast.LENGTH_SHORT).show();
          }
          else
          {
               Toast.makeText(getApplicationContext(), "not work", Toast.LENGTH_SHORT).show();
          }
     }
});

questionAnswers(3)

yourAnswerToTheQuestion