@Test
public void testSanitize() {

    LicenseNameWithText licenseNameWithText;
    licenseNameWithText = createLicense("name", null, null);
    LicenseNameWithTextUtils.sanitize(licenseNameWithText);
    Assert.assertThat(licenseNameWithText.getLicenseName(), Matchers.is("name"));
    licenseNameWithText = createLicense("\n", null, null);
    LicenseNameWithTextUtils.sanitize(licenseNameWithText);
    Assert.assertNull(licenseNameWithText.getLicenseName());
    licenseNameWithText = createLicense(null, "text", null);
    LicenseNameWithTextUtils.sanitize(licenseNameWithText);
    Assert.assertThat(licenseNameWithText.getLicenseText(), Matchers.is("text"));
    licenseNameWithText = createLicense(null, " ", null);
    LicenseNameWithTextUtils.sanitize(licenseNameWithText);
    Assert.assertNull(licenseNameWithText.getLicenseText());
    licenseNameWithText = createLicense(null, null, "acks");
    LicenseNameWithTextUtils.sanitize(licenseNameWithText);
    Assert.assertThat(licenseNameWithText.getAcknowledgements(), Matchers.is("acks"));
    licenseNameWithText = createLicense(null, null, "  ");
    LicenseNameWithTextUtils.sanitize(licenseNameWithText);
    Assert.assertNull(licenseNameWithText.getAcknowledgements());
}