@Test
public void testIsVisible() throws Exception {

    assertThat(FossologyFileHandler.isVisible(null), is(false));
    for (FossologyStatus fossologyStatus : FossologyStatus.values()) {
        final boolean expectedVisible;
        switch (fossologyStatus) {
            case CONNECTION_FAILED:
            case ERROR:
            case NON_EXISTENT:
            case NOT_SENT:
            case INACCESSIBLE:
                expectedVisible = false;
                break;
            case SENT:
            case SCANNING:
            case OPEN:
            case IN_PROGRESS:
            case CLOSED:
            case REJECTED:
            case REPORT_AVAILABLE:
            default:
                expectedVisible = true;
                break;
        }
        String errorMessage = "" + fossologyStatus + " should" + (expectedVisible ? "" : " not") + " be visible";
        assertThat(errorMessage, FossologyFileHandler.isVisible(fossologyStatus), is(expectedVisible));
    }
}