### Question:
ClientSideLoggingBehavior extends Behavior { public static Builder newBuilder() { return new Builder(); } ClientSideLoggingBehavior();  ClientSideLoggingBehavior(final Map<String, Object> data); static Builder newBuilder(); static Builder newBuilder(final String spec); @Override void renderHead(Component component, IHeaderResponse response);  }### Answer:
@Test public void builderConstructsCorrectBehavior() { ClientSideLoggingBehavior.Builder b = ClientSideLoggingBehavior.newBuilder(); assertThat(b.build(), is(notNullValue())); assertThat(b.data().size(), is(equalTo(0))); }
@Test public void builderConstructsCorrectBehaviorWhenUsingNonDefaultSettings() { ClientSideLoggingBehavior.Builder b = ClientSideLoggingBehavior.newBuilder() .collectClientInfos(false) .collectionType(CollectionType.Unload) .collectionTimer(Duration.seconds(100)); assertThat(b.data().size(), is(equalTo(3))); assertThat(b.data().containsKey("collectClientInfos"), is(true)); assertThat(b.data().containsKey("collectionType"), is(true)); assertThat(b.data().containsKey("collectionTimer"), is(true)); }
@Test public void builderWithSpecConstructsCorrectBehaviorWhenUsingNonDefaultSettings() { ClientSideLoggingBehavior.Builder b = ClientSideLoggingBehavior.newBuilder("collectClientInfos=false,collectionType=Unload,collectionTimer=100 seconds"); assertThat(b.data().size(), is(equalTo(3))); assertThat(b.data().containsKey("collectClientInfos"), is(true)); assertThat(b.data().containsKey("collectionType"), is(true)); assertThat(b.data().containsKey("collectionTimer"), is(true)); }
@Test public void builderConstructsCorrectSubclassOfBehavior() { ClientSideLoggingBehavior.Builder b = ClientSideLoggingBehavior.newBuilder(); assertThat(b.build(MyBehavior.class), is(notNullValue())); assertThat(b.build(MyBehavior.class), is(instanceOf(MyBehavior.class))); }
@Test public void dateFormatIsAdded() { ClientSideLoggingBehavior.Builder b = ClientSideLoggingBehavior.newBuilder().dateFormat("dd.MM.yyyy"); assertThat(b.data().containsKey("dateFormat"), is(true)); assertThat(b.data().get("dateFormat").toString(), is("dd.MM.yyyy")); }