Suspicious type cast or check

Description:

The same variable is casted to several incompatible type. Or variable is casted to some type and then checked to be instance of incompatible type. Incompatible here means that two target classes are not related: i.e. none of them is derived from the other.

Example:

class A { 
    ...
}
class B {
    ...
}
...
void foo(Object o) { 
   ((B)o).someMethod(); 
   ((A)o).anotherMetod(); // o can not be A and B at the same time
}