### Question:
ScriptExecutionAdderImpl implements ScriptExecutionAdder { @Override public ScriptExecutionAdder withReplace(final String recordName, final Record record) { if (recordName == null) { throw new NullPointerException("Record name cannot be null."); } if (record == null) { throw new NullPointerException("Record cannot be null."); } if (recordName.trim().length() == 0) { throw new IllegalArgumentException("Record name cannot be blank."); } final String upperName = recordName.toUpperCase(Locale.getDefault()); records.put(upperName, record); return this; } ScriptExecutionAdderImpl(final String scriptName, final CommandQueue queue); @Override void commit(); @Override ScriptExecutionAdder withReplace(final String recordName, final Record record); @Override ScriptExecutionAdder withArguments(final Argument... arguments); @Override ScriptExecutionAdder withAuthentication(final boolean authenticate);  }### Answer:
@Test public void testWithReplaceBlankRecordName() { IllegalArgumentException e = assertThrows(IllegalArgumentException.class, () -> { adder.withReplace(" ", mock(Record.class)); }); assertThat(e.getMessage()).isEqualTo("Record name cannot be blank."); }
@Test public void testWithReplaceNullRecord() { NullPointerException e = assertThrows(NullPointerException.class, () -> { adder.withReplace("recordName", null); }); assertThat(e.getMessage()).isEqualTo("Record cannot be null."); }
@Test public void testWithReplaceNullRecordName() { NullPointerException e = assertThrows(NullPointerException.class, () -> { adder.withReplace(null, mock(Record.class)); }); assertThat(e.getMessage()).isEqualTo("Record name cannot be null."); }