class OresHelper {

    public static OLATResourceable createOLATResourceableInstance(final String type, final Long key) {
        if (key == null)
            throw new AssertException("key may not be null; type = " + type);
        if (type.length() > ORES_TYPE_LENGTH)
            throw new AssertException("Olatresource type may not exceed " + ORES_TYPE_LENGTH + " chars: type=" + type);
        return new OLATResourceable() {
            @Override
            public String getResourceableTypeName() {
                return type;
            }

            @Override
            public Long getResourceableId() {
                return key;
            }
        };
    }

}