import java.util.function.Function;

public interface Interfaces<T> {
    String CONSTANT = "interface constant";

    int ABSTRACT_ANSWER = 42;

    T identity(T value);

    default T twice(T value) {
        return identity(identity(value));
    }

    static <R> Function<R, R> factory() {
        return value -> value;
    }

    @FunctionalInterface
    interface Nested {
        void run() throws Exception;
    }

    abstract class Partial<T> implements Interfaces<T> {
        static final Object LOCK = new Object();

        static {
            System.getProperties();
        }

        @Override
        public T twice(T value) {
            synchronized (LOCK) {
                return identity(value);
            }
        }
    }
}
