Section { public boolean isLead() { return id == 0; } Section();  Section(int id, int level, String heading, String anchor, String content); static Section fromJson(JSONObject json); JSONObject toJSON(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); boolean isLead(); int getId(); int getLevel(); @NonNull String getHeading(); @NonNull String getAnchor(); @NonNull String getContent();  }
@Test public void testSectionLead() { Section section = new Section(0, 0, "Heading", "Heading", "Content"); assertThat(section.isLead(), is(true)); section = new Section(1, 1, "Heading", "Heading", "Content"); assertThat(section.isLead(), is(false)); section = new Section(1, 0, "Heading", "Heading", "Content"); assertThat(section.isLead(), is(false)); }