 <p>You could write an interface <code>NullCheckable</code></p> <pre><code>public interface NullCheckable { boolean areAllPropertiesNull(); } </code></pre> <p>Then each class you want to be able to check implements this interface with the appropriate method e.g.</p> <pre><code>public class Class1 implements NullCheckable { private Object property1; public Object getProperty1() { return property1; } @Override public boolean areAllPropertiesNull() { return property1 == null; } } </code></pre>