ParsingUtils { public static boolean fileMatchesExtension(final File file, final String targetExtension) { String fileName = file.getName(); int i = fileName.lastIndexOf("."); if (i > 0) { String actualExtension = fileName.substring(i + 1); if (targetExtension.equals(actualExtension)) { return true; } } return false; }  static boolean fileMatchesExtension(final File file,
            final String targetExtension); static String formatSampleText(final List<String> lines,
            final int maxTrim); static int getMinWhitespace(final List<String> lines); static int getLeadingWhitespace(final String str); static String trimLeadingWhitespace(final String str, final int max); static String assertFieldHasContent(final String field,
            final String value); static boolean checkAndLogIfNoContent(String sampleId, String field, String value);  }
@Test public void fileMatchesExtension() throws Exception { File sampleFile = getSampleFile("EmptySamples.java"); assertTrue(ParsingUtils.fileMatchesExtension(sampleFile, "java")); }
@Test public void fileDoesNotMatchExtension() throws Exception { File sampleFile = getSampleFile("BadExtension.cpp"); assertFalse(ParsingUtils.fileMatchesExtension(sampleFile, "java")); }