Package { public boolean isUndefined() { return UNDEFINED.equals(this); } private  Package();  Package(@Nonnull final String packageName); @Override boolean equals(final Object obj); @Nonnull String getName(); @Override int hashCode(); boolean isUndefined(); @Override String toString(); static final Package UNDEFINED; static final Package JAVA_LANG; }
@Test public void isUndefined() { assertTrue(Package.UNDEFINED.isUndefined()); assertFalse(Package.JAVA_LANG.isUndefined()); assertFalse(new Package("net.sf.qualitycheck").isUndefined()); }