### Question:
MinifiedFilesFilter implements InputFileFilter { @Override public boolean accept(InputFile file) { if (!CssLanguage.KEY.equals(file.language())) { return true; } try { boolean isMinified = hasMinifiedFileName(file) || hasExcessiveAverageLineLength(file); if (isMinified) { LOG.debug("File [" + file.uri() + "] looks like a minified file and will not be analyzed"); } return !isMinified; } catch (IOException e) { throw new IllegalStateException("Failed to read input file", e); } }  @Override boolean accept(InputFile file);  }### Answer:
@Test public void should_exclude_by_name() throws Exception { DefaultInputFile jsFile = TestInputFileBuilder.create("", "foo.min.css") .setLanguage("css") .setContents("short content") .build(); assertThat(MINIFIED_FILES_FILTER.accept(jsFile)).isFalse(); }
@Test public void should_keep_other_lang() throws Exception { DefaultInputFile jsFile = TestInputFileBuilder.create("", "foo.min.css").setLanguage("js").build(); assertThat(MINIFIED_FILES_FILTER.accept(jsFile)).isTrue(); }
@Test public void should_exclude_by_content() throws Exception { String longContent = new String(new char[500]).replace("\0", "a") + "\n"; DefaultInputFile jsFile = TestInputFileBuilder.create("", "foo.css") .setLanguage("css") .setContents(longContent) .build(); assertThat(MINIFIED_FILES_FILTER.accept(jsFile)).isFalse(); }