java.lang.NoSuchMethodError: ‘com.google.common.collect.ImmutableMap Selenium 4 webdriver chrome Maven project

To fix this, first check your project has any dependency related to “com.google.guava”. like older versions resolve that dependencies. Remove the older versions

And add this dependency in your pom.xml or in project build path

<dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>31.0.1-jre</version>
    </dependency>

Module not found: Error: Can’t resolve ‘./serviceWorker’ in React compilation error

Use

npx create-react-app app-name –template cra-template-pwa

Rather

npx create-react-app app-name

Read excel and convert to Hashmap ConcurrentHashMap using Java

public static ConcurrentHashMap<String, ConcurrentHashMap<String, String>> dataMap = new ConcurrentHashMap<>();
	public static ConcurrentHashMap<String, String> cellValues = null;

	public static void main(String[] args) {
		getData();
		for (String key : dataMap.keySet()) {

			System.out.println(dataMap.get(key));
		}
	}

	private static Object getCellValue(Cell cell) {

		switch (cell.getCellType()) {
		case STRING:
			return cell.getStringCellValue();
		case NUMERIC:
			return cell.getNumericCellValue();

		case BOOLEAN:
			return cell.getBooleanCellValue();
		default:
			break;
		}

		return null;
	}

	public static void getData() {
		try {

			FileInputStream fis = new FileInputStream("Data/ServiceTesting.xlsx");
			XSSFWorkbook workbook = new XSSFWorkbook(fis);
			XSSFSheet sheet = workbook.getSheetAt(0);
			Iterator<Row> rowIterator = sheet.iterator();
			while (rowIterator.hasNext()) {
				Row row = rowIterator.next();
				Iterator<Cell> cellIterator = row.cellIterator();
				String key = row.getCell(0).toString();
				cellValues = new ConcurrentHashMap<>();
				while (cellIterator.hasNext()) {
					Cell cell = cellIterator.next();
					if (cell.getRowIndex() != 0) {

						String header = sheet.getRow(0).getCell(cell.getColumnIndex()).getStringCellValue();
						String clellValue = (String) getCellValue(cell);
						cellValues.put(header, clellValue);
					}

				}
				if (row.getRowNum() != 0) {
					dataMap.put(key, cellValues);
				}

			}
			workbook.close();
			fis.close();

		} catch (Exception e) {
			e.printStackTrace();
		}

	}