S2Utils { static int getNumBandsToRcCorrect(String[] sourceBandNames) { int numBandsToRcCorrect = 0; for (String sourceBandName : sourceBandNames) { for (String bandToRcCorrect : SensorConstants.S2_MSI_SPECTRAL_BAND_NAMES) { if (sourceBandName.equals(bandToRcCorrect)) { numBandsToRcCorrect++; break; } } } return numBandsToRcCorrect; }    }
@Test public void testGetNumBandsToRcCorrect() throws Exception { String[] inputBands = new String[]{"B1", "B4", "B7", "B8A"}; assertEquals(4, S2Utils.getNumBandsToRcCorrect(inputBands)); inputBands = new String[]{"B7", "B8A", "B10", "B11"}; assertEquals(4, S2Utils.getNumBandsToRcCorrect(inputBands)); inputBands = new String[]{"B12", "B10", "B11"}; assertEquals(3, S2Utils.getNumBandsToRcCorrect(inputBands)); }