Counter part to Scala's equivalent