// Path: src/main/java/com/github/vbauer/jconditions/core/CheckerContext.java
// public class CheckerContext<T> {
// 
//     private final Object instance;
//     private final T annotation;
// 
// 
//     public CheckerContext(final Object instance, final T annotation) {
//         this.instance = instance;
//         this.annotation = annotation;
//     }
// 
// 
//     public Object getInstance() {
//         return instance;
//     }
// 
//     public T getAnnotation() {
//         return annotation;
//     }
// 
// }
// 
// Path: src/main/java/com/github/vbauer/jconditions/core/ConditionChecker.java
// public interface ConditionChecker<T> {
// 
//     /**
//      * Checks if execution of test method should be continued or not.
//      *
//      * @param context input data for checker
//      * @return true if execution should be continued and false - otherwise
//      * @throws Exception on any error (it is the same as false in return value)
//      */
//     boolean isSatisfied(CheckerContext<T> context) throws Exception;
// 
// }
// 
// Path: src/main/java/com/github/vbauer/jconditions/util/PropUtils.java
// public final class PropUtils {
// 
//     private static final String VAR_PREFIX = "${";
//     private static final String VAR_POSTFIX = "}";
// 
// 
//     private PropUtils() {
//         throw new UnsupportedOperationException();
//     }
// 
// 
//     public static String getSystemProperty(final String key) {
//         final Map<String, String> properties = getSystemProperties();
//         return properties.get(key);
//     }
// 
//     public static Map<String, String> getSystemProperties() {
//         final Map<String, String> result = new HashMap<>();
//         result.putAll(System.getenv());
//         result.putAll(convertPropertiesToMap(System.getProperties()));
//         return result;
//     }
// 
//     public static Map<String, String> convertPropertiesToMap(final Properties properties) {
//         final Map<String, String> result = new HashMap<>();
//         for (final String name : properties.stringPropertyNames()) {
//             result.put(name, properties.getProperty(name));
//         }
//         return result;
//     }
// 
//     public static String injectProperties(final String text) {
//         if (text != null && text.contains(VAR_PREFIX)) {
//             String result = text;
//             final Map<String, String> systemProperties = getSystemProperties();
//             for (final Map.Entry<String, String> entry : systemProperties.entrySet()) {
//                 final String key = entry.getKey();
//                 final String value = entry.getValue();
//                 result = result.replace(VAR_PREFIX + key + VAR_POSTFIX, value);
//             }
//             return result;
//         }
//         return text;
//     }
// 
//     public static boolean hasAnyWithProperties(final String value, final String... variants) {
//         for (final String operationSystem : variants) {
//             final String injected = injectProperties(operationSystem);
//             if (TextUtils.containsIgnoreCase(value, injected)) {
//                 return true;
//             }
//         }
//         return false;
//     }
// 
// }
// 
// Path: src/main/java/com/github/vbauer/jconditions/util/TextUtils.java
// public final class TextUtils {
// 
//     private TextUtils() {
//         throw new UnsupportedOperationException();
//     }
// 
// 
//     public static boolean equalsSafe(final String a, final String b) {
//         return a == null && b == null || a != null && a.equals(b);
//     }
// 
//     public static boolean containsIgnoreCase(final String a, final String b) {
//         return a != null && b != null && a.toLowerCase().contains(b.toLowerCase());
//     }
// 
// }


import com.github.vbauer.jconditions.annotation.PropertyIsDefined;
import com.github.vbauer.jconditions.core.CheckerContext;
import com.github.vbauer.jconditions.core.ConditionChecker;
import com.github.vbauer.jconditions.util.PropUtils;
import com.github.vbauer.jconditions.util.TextUtils;
package com.github.vbauer.jconditions.checker;


/**
 * @author Vladislav Bauer
 */

public class PropertyIsDefinedChecker implements ConditionChecker<PropertyIsDefined> {

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean isSatisfied(final CheckerContext<PropertyIsDefined> context) {
        final PropertyIsDefined annotation = context.getAnnotation();
        final String[] keys = annotation.keys();
        final String[] values = annotation.values();

        return isSatisfied(keys, values);
    }


    private boolean isSatisfied(final String[] keys, final String[] values) {
        int index = 0;
        for (final String key : keys) {
// Path: src/main/java/com/github/vbauer/jconditions/core/CheckerContext.java
// public class CheckerContext<T> {
// 
//     private final Object instance;
//     private final T annotation;
// 
// 
//     public CheckerContext(final Object instance, final T annotation) {
//         this.instance = instance;
//         this.annotation = annotation;
//     }
// 
// 
//     public Object getInstance() {
//         return instance;
//     }
// 
//     public T getAnnotation() {
//         return annotation;
//     }
// 
// }
// 
// Path: src/main/java/com/github/vbauer/jconditions/core/ConditionChecker.java
// public interface ConditionChecker<T> {
// 
//     /**
//      * Checks if execution of test method should be continued or not.
//      *
//      * @param context input data for checker
//      * @return true if execution should be continued and false - otherwise
//      * @throws Exception on any error (it is the same as false in return value)
//      */
//     boolean isSatisfied(CheckerContext<T> context) throws Exception;
// 
// }
// 
// Path: src/main/java/com/github/vbauer/jconditions/util/PropUtils.java
// public final class PropUtils {
// 
//     private static final String VAR_PREFIX = "${";
//     private static final String VAR_POSTFIX = "}";
// 
// 
//     private PropUtils() {
//         throw new UnsupportedOperationException();
//     }
// 
// 
//     public static String getSystemProperty(final String key) {
//         final Map<String, String> properties = getSystemProperties();
//         return properties.get(key);
//     }
// 
//     public static Map<String, String> getSystemProperties() {
//         final Map<String, String> result = new HashMap<>();
//         result.putAll(System.getenv());
//         result.putAll(convertPropertiesToMap(System.getProperties()));
//         return result;
//     }
// 
//     public static Map<String, String> convertPropertiesToMap(final Properties properties) {
//         final Map<String, String> result = new HashMap<>();
//         for (final String name : properties.stringPropertyNames()) {
//             result.put(name, properties.getProperty(name));
//         }
//         return result;
//     }
// 
//     public static String injectProperties(final String text) {
//         if (text != null && text.contains(VAR_PREFIX)) {
//             String result = text;
//             final Map<String, String> systemProperties = getSystemProperties();
//             for (final Map.Entry<String, String> entry : systemProperties.entrySet()) {
//                 final String key = entry.getKey();
//                 final String value = entry.getValue();
//                 result = result.replace(VAR_PREFIX + key + VAR_POSTFIX, value);
//             }
//             return result;
//         }
//         return text;
//     }
// 
//     public static boolean hasAnyWithProperties(final String value, final String... variants) {
//         for (final String operationSystem : variants) {
//             final String injected = injectProperties(operationSystem);
//             if (TextUtils.containsIgnoreCase(value, injected)) {
//                 return true;
//             }
//         }
//         return false;
//     }
// 
// }
// 
// Path: src/main/java/com/github/vbauer/jconditions/util/TextUtils.java
// public final class TextUtils {
// 
//     private TextUtils() {
//         throw new UnsupportedOperationException();
//     }
// 
// 
//     public static boolean equalsSafe(final String a, final String b) {
//         return a == null && b == null || a != null && a.equals(b);
//     }
// 
//     public static boolean containsIgnoreCase(final String a, final String b) {
//         return a != null && b != null && a.toLowerCase().contains(b.toLowerCase());
//     }
// 
// }


// Path: src/main/java/com/github/vbauer/jconditions/checker/PropertyIsDefinedChecker.java
import com.github.vbauer.jconditions.annotation.PropertyIsDefined;
import com.github.vbauer.jconditions.core.CheckerContext;
import com.github.vbauer.jconditions.core.ConditionChecker;
import com.github.vbauer.jconditions.util.PropUtils;
import com.github.vbauer.jconditions.util.TextUtils;

package com.github.vbauer.jconditions.checker;


/**
 * @author Vladislav Bauer
 */

public class PropertyIsDefinedChecker implements ConditionChecker<PropertyIsDefined> {

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean isSatisfied(final CheckerContext<PropertyIsDefined> context) {
        final PropertyIsDefined annotation = context.getAnnotation();
        final String[] keys = annotation.keys();
        final String[] values = annotation.values();

        return isSatisfied(keys, values);
    }


    private boolean isSatisfied(final String[] keys, final String[] values) {
        int index = 0;
        for (final String key : keys) {
            final String variable = PropUtils.getSystemProperty(