private static Type getTypeForKeyword(Keyword keyword) {
        for (Type type : Type.values()) {
            if (type.toString().equalsIgnoreCase(keyword.toString())) {
                return type;
            }
        }

        throw new IllegalStateException("Could not find a mass type for the "
                + "keyword " + keyword + ", but this should never happen.");
    }