Consider a class Coin that representsa coin. The class hasmethods such as getValue toss andisHeads. The method getValuereturns the value or denomination of acoin. The method tosssimulates a cointoss in which the coin lands either heads up ortails up. Themethod isHeads returns true if a coin isheads up.Suppose that coinList is anADT list of coins that haverandomlyselected denominations. Toss each of these coins. If theresult ofa coin toss is heads move the coin to a second listcalledheadsList; if it is tails leavethe coin in the original list. Whenyou are finished tossing coinscompute the total value of the coinsthat came up heads. Assume that the list headsList hasbeen createdfor you and is emptyinitially.