class GetFirstNotNullRule implements IResolveDependencyStrategy {

    @Override
    public <T> T resolve(Object... args) throws ResolveDependencyStrategyException {
        for (Object arg : args) {
            if (arg != null) {
                return (T) arg;
            }
        }
        throw new ResolveDependencyStrategyException("All objects are null: " + Arrays.toString(args));
    }

}