### Question:
NodeBuilderBaseImpl { public B withName(final String name) { this.name.set(name); return ensureRuntimeSelfReference(); } NodeBuilderBaseImpl();   NodeBuilderBaseImpl(final Node node); B withErrorHandler(final ErrorHandler errorHandler); B withoutErrorHandler(); B withName(final String name); B withCredential(final Credential credential); B withoutCredential(final Credential credential); B clearCredentials(); B withRetryMax(final Integer retryMax); B withRetryInterval(final Integer retryInterval); B withRetryPolicy(final String retryPolicy); B withParent(final Node parent); B withParentWithCondition(final Node parent, final String condition); B withParentDefaultConditional(final Node parent); B withoutParent(final Node parent); B clearParents();  }### Answer:
@Test public final void testIncorrectSubclassingThrows() { class WrongBuilder extends NodeBuilderBaseImpl<MapReduceActionBuilder> implements Builder<MapReduceAction> { private WrongBuilder() { super(); } public MapReduceActionBuilder getRuntimeSelfReference() { return MapReduceActionBuilder.create(); } @Override public MapReduceAction build() { return null; } } expectedException.expect(IllegalStateException.class); new WrongBuilder().withName("obsolete"); }
@Test public void testNameAdded() { final B builder = getBuilderInstance(); builder.withName(NAME); final N action = builder.build(); assertEquals(NAME, action.getName()); }
@Test public void testNameAddedTwiceThrows() { final B builder = getBuilderInstance(); builder.withName(NAME); expectedException.expect(IllegalStateException.class); builder.withName("any_name"); }