public static <GInput, GValue> Field<GInput, GValue> conditionalField(final Filter<? super GInput> condition, final Field<? super GInput, GValue> accept,
		final Field<? super GInput, GValue> reject) throws NullPointerException {
		if (condition == null) throw new NullPointerException("condition = null");
		if (accept == null) throw new NullPointerException("accept = null");
		if (reject == null) throw new NullPointerException("reject = null");
		return new Field<GInput, GValue>() {

			@Override
			public GValue get(final GInput input) {
				return condition.accept(input) ? accept.get(input) : reject.get(input);
			}

			@Override
			public void set(final GInput input, final GValue value) {
				if (condition.accept(input)) {
					accept.set(input, value);
				} else {
					reject.set(input, value);
				}
			}

			@Override
			public String toString() {
				return Objects.toInvokeString("conditionalField", condition, accept, reject);
			}

		};
	}