SubjectNode implements PolicyTreeNode { public static SubjectNode of(final String name) { checkNotNull(name, "Name"); return new SubjectNode(name); } private  SubjectNode(final String name); static SubjectNode of(final String name); @Override String getName(); @Nonnull @Override Type getType(); @Override Optional<PolicyTreeNode> getChild(final String resourceName); @Override void addChild(final PolicyTreeNode childNode); @Override void accept(@Nonnull final Visitor visitor); @Override Map<String, PolicyTreeNode> getChildren(); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString();  }
@Test(expected = NullPointerException.class) public void tryToCreateInstanceWithNullName() { SubjectNode.of(null); }