### Question:
LogicalLogRecord { T getMessage() { return message; } LogicalLogRecord(Instant timestamp, DiagnosticContext diagnosticContext, T message, Optional<Throwable> cause, Object... details); String format(StackTraceProcessor processor);  }### Answer:
@Test public void constructor_shouldThrowANullPointerException_givenANullTimestamp() throws Exception { try { new LogicalLogRecord<>(null, SAMPLE_DIAGNOSTIC_CONTEXT, TestMessages.Foo, Optional.empty()); fail("expected an exception"); } catch (NullPointerException e) { assertThat(e.getMessage(), containsString("parameter timestamp")); } }
@Test public void constructor_shouldThrowANullPointerException_givenANullDiagnosticContext() throws Exception { try { new LogicalLogRecord<>(Instant.now(), null, TestMessages.Foo, Optional.empty()); fail("expected an exception"); } catch (NullPointerException e) { assertThat(e.getMessage(), containsString("parameter diagnosticContext")); } }
@Test public void constructor_shouldThrowANullPointerException_givenANullMessage() throws Exception { try { new LogicalLogRecord<TestMessages>(Instant.now(), SAMPLE_DIAGNOSTIC_CONTEXT, null, Optional.empty()); fail("expected an exception"); } catch (NullPointerException e) { assertThat(e.getMessage(), containsString("parameter message")); } }
@Test public void constructor_shouldThrowANullPointerException_givenANullCause() throws Exception { try { new LogicalLogRecord<>(Instant.now(), SAMPLE_DIAGNOSTIC_CONTEXT, TestMessages.Foo, null); fail("expected an exception"); } catch (NullPointerException e) { assertThat(e.getMessage(), containsString("parameter cause")); } }
@Test public void constructor_shouldThrowANullPointerException_givenNullDetails() throws Exception { try { new LogicalLogRecord<>(Instant.now(), SAMPLE_DIAGNOSTIC_CONTEXT, TestMessages.Foo, Optional.empty(), (Object[]) null); fail("expected an exception"); } catch (NullPointerException e) { assertThat(e.getMessage(), containsString("parameter details")); } }