class DefaultKeyProvider implements KeyProvider {

    @Override
    public String generateKey(final Object keyObject) {
        if (keyObject == null) {
            throw new InvalidParameterException("keyObject must be defined");
        }
        try {
            final Method keyMethod = getKeyMethod(keyObject);
            return generateObjectId(keyMethod, keyObject);
        } catch (Exception ex) {
            throw new RuntimeException(ex);
        }
    }

}