T () { T value = getStoredValue(); if (ArrayUtil.contains(value, myPolicies)) return value; List<T> substitutes = getValueSubstitutes(value); for (T substitute : substitutes) { if (ArrayUtil.contains(substitute, myPolicies)) return substitute; } return myPolicies[0]; }