package com.hash; import java.util.HashMap; public class Apple { private String color; public Apple(String color) { this.color = color; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((color == nul…