MetadataBuilder extends ComponentSupport { public boolean onEnterArtifactId(final String artifactId) { checkState(groupId != null); checkNotNull(artifactId); if (Objects.equals(artifactId, this.artifactId)) { return false; } this.artifactId = artifactId; this.baseVersion = null; baseVersions.clear(); log.debug("-> GA: {}:{}", groupId, artifactId); return true; } MetadataBuilder(); boolean onEnterGroupId(final String groupId); @Nullable Maven2Metadata onExitGroupId(); boolean addPlugin(final String prefix, final String artifactId, final String name); boolean onEnterArtifactId(final String artifactId); @Nullable Maven2Metadata onExitArtifactId(); boolean onEnterBaseVersion(final String baseVersion); @Nullable Maven2Metadata onExitBaseVersion(); void addArtifactVersion(final MavenPath mavenPath);  }
@Test(expected = IllegalStateException.class) public void wrongEnterA() { testSubject.onEnterArtifactId("foo"); }