code: private Rotation isValidPermutation(List<Integer> permutation) {
  		if (permutation.size() == 0) {
  			return null;
  		}
  
  		// cached value
  		if (evaluatedPermutations.containsKey(permutation)) {
  			return evaluatedPermutations.get(permutation);
  		}
  
  		// check if permutation is allowed
  		if (! isAllowedPermutation(permutation)) {
  			evaluatedPermutations.put(permutation, null);
  			return null;
  		}
  
  		// check if superimposes
  		Rotation rot = superimposePermutation(permutation);
  		return rot;
  	}
docs: Checks if a particular permutation is allowed and superimposes well.
  Caches results.
  @param permutation
  @return null if invalid, or a rotation if valid