### Question:
ScriptExecutionBuilder { public void addWithReplace(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); } private  ScriptExecutionBuilder(final String scriptName); static ScriptExecutionBuilder getBuilder(final String scriptName); void addWithReplace(final String recordName, final Record record); Collection<String> build(); String getScriptName(); ScriptExecutionBuilder withArguments(final List<Argument> arguments);  }### Answer:
@Test public void testAddWithReplace() { final Record record = mock(Record.class); final String recordName = "mock_request"; builder.addWithReplace(recordName, record); assertThat(builder.getRecordStructures()).includes(entry(recordName.toUpperCase(), record)); }
@Test public void testAddWithReplaceBlankName() { IllegalArgumentException e = assertThrows(IllegalArgumentException.class, () -> { builder.addWithReplace(" ", mock(Record.class)); }); assertThat(e.getMessage()).isEqualTo("Record name cannot be blank."); }
@Test public void testAddWithReplaceNullName() { NullPointerException e = assertThrows(NullPointerException.class, () -> { builder.addWithReplace(null, mock(Record.class)); }); assertThat(e.getMessage()).isEqualTo("Record name cannot be null."); }
@Test public void testAddWithReplaceNullRecord() { NullPointerException e = assertThrows(NullPointerException.class, () -> { builder.addWithReplace("request", null); }); assertThat(e.getMessage()).isEqualTo("Record cannot be null."); }