public static ArrayList<Property> allProperties(State state) { ArrayList<Property> result = new ArrayList<Property>(); // Properties from the states for (State s : allContainingStates(state)) { result.addAll(s.getProperties()); } // Properties from the thing result.addAll(allProperties(findContainingThing(state))); return result; }