### Question:
AbstractCompilerAdder { protected void setListingLocation(final File listingLocation) { if (listingLocation == null) throw new NullPointerException("Listing location cannot be null."); this.listingLocation = listingLocation; }    }### Answer:
@Test public void testSetListingLocation() { final File listingLocation = mock(File.class); adder.setListingLocation(listingLocation); assertThat(adder.getListingLocation()).isEqualTo(listingLocation); }
@Test public void testSetListingLocationNullFile() { NullPointerException e = assertThrows(NullPointerException.class, () -> { adder.setListingLocation(null); }); assertThat(e.getMessage()).isEqualTo("Listing location cannot be null."); }