I have a class that implements serializable and I need it to be there.
public class Alpha implements Beta {
}
Is there a way to check that it is implementing Beta via a unit test?
I have a class that implements serializable and I need it to be there.
public class Alpha implements Beta {
}
Is there a way to check that it is implementing Beta via a unit test?
The easiest way to test a class is just to require that type as a parameter:
public void someMethod( Beta b ) {
// ...
}
For Serializable, just use that type.
public void otherMethod( Serializable ser ) {
If you need a class that implements two types, then you should make an interface that expresses that type.
public interface MyType extends Beta, Serializable {}
Then just use MyType
wherever you need both types.