Element { public boolean hasHooks() { return getBefore().size() > 0 || getAfter().size() > 0; }  List<Tag> getTags(); void setTags(final List<Tag> tags); String getStartTimestamp(); void setStartTimestamp(final String startTimestamp); ZonedDateTime getStartDateTime(); ZonedDateTime getEndDateTime(); String getStartDateString(); String getStartTimeString(); String getEndDateString(); String getEndTimeString(); List<ResultMatch> getBefore(); void setBefore(final List<ResultMatch> before); int getLine(); void setLine(final int line); String getName(); void setName(final String name); String getDescription(); void setDescription(final String description); String getId(); void setId(final String id); List<ResultMatch> getAfter(); void setAfter(final List<ResultMatch> after); String getType(); void setType(final String type); String getKeyword(); void setKeyword(final String keyword); List<Step> getSteps(); void setSteps(final List<Step> steps); boolean isScenario(); boolean isFailed(); boolean isPassed(); boolean isSkipped(); Status getStatus(); int getScenarioIndex(); void setScenarioIndex(final int scenarioIndex); int getTotalNumberOfSteps(); int getTotalNumberOfPassedSteps(); int getTotalNumberOfFailedSteps(); int getTotalNumberOfSkippedSteps(); long getTotalDuration(); String returnTotalDurationString(); boolean hasHooks(); boolean hasDocStrings(); boolean hasStepHooks(); List<ResultMatch> getAllResultMatches(); String getFeatureName(); void setFeatureName(final String featureName); int getFeatureIndex(); void setFeatureIndex(final int featureIndex); void setFailOnPendingOrUndefined(final boolean failOnPendingOrUndefined); String getFeatureUri(); void setFeatureUri(String featureUri);  }
@Test public void hasHooksTest() { assertThat(element.hasHooks(), is(false)); List<ResultMatch> before = new ArrayList<>(); before.add(new ResultMatch()); element.setBefore(before); assertThat(element.hasHooks(), is(true)); }