@Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Group group = (Group) o;

        return Double.compare(group.mass, mass) == 0 && !(elements != null ? !elements.equals(group.elements) : group.elements != null);

    }