PlacemarkIO { static int findColumnIndex(String[] strings, String... colNames) { int index = -1; for (String colName : colNames) { index = StringUtils.indexOfIgnoreCase(strings, colName); if(index != -1) { break; } } return index; } private  PlacemarkIO(); static List<Placemark> readPlacemarks(Reader reader, GeoCoding geoCoding,
                                                 PlacemarkDescriptor placemarkDescriptor); static void writePlacemarksWithAdditionalData(Writer writer,
                                                         String roleLabel, String productName,
                                                         List<Placemark> placemarkList, List<Object[]> valueList,
                                                         String[] standardColumnNames, String[] additionalColumnNames); static void writePlacemarksFile(Writer writer, List<Placemark> placemarks); static BeamFileFilter createTextFileFilter(); static BeamFileFilter createPlacemarkFileFilter(); static Placemark createPlacemark(Element element, PlacemarkDescriptor descriptor, GeoCoding geoCoding); static void writeXML(Placemark placemark, XmlWriter writer, int indent); static void writeColor(final String tagName, final int indent, final Color color, final XmlWriter writer); static final String FILE_EXTENSION_FLAT_OLD; static final String FILE_EXTENSION_XML_OLD; static final String FILE_EXTENSION_FLAT_TEXT; static final String FILE_EXTENSION_PLACEMARK; }
@Test public void testFindColumnIndex() throws Exception { assertEquals(1, PlacemarkIO.findColumnIndex(new String[]{"col1", "cOL2", "CoL3"}, "cOL2")); assertEquals(1, PlacemarkIO.findColumnIndex(new String[]{"col1", "cOL2", "CoL3"}, "col2")); assertEquals(-1, PlacemarkIO.findColumnIndex(new String[]{"col1", "cOL2", "CoL3"}, "abc")); assertEquals(0, PlacemarkIO.findColumnIndex(new String[]{"col1", "cOL2", "CoL3"}, "abc", "xyz", "COL1")); assertEquals(1, PlacemarkIO.findColumnIndex(new String[]{"col1", "cOL2", "CoL3"}, "COL2", "col2")); }