I'm trying to make mock that should return different value if the argument had concrete class. I created tableVerificationService mock object and created these when conditions.
Mockito.when(tableVerificationService.verify(Mockito.any())).thenReturn(true);
Mockito.when(tableVerificationService.verify(Mockito.any(DTable.class))).thenReturn(false);
But now it returns false in any case, even if i pass another from DTable object.
If i change order of these two lines, it will return true in all cases. Is there any way to make correct behavior?