Reflection of an object in a 3D world
From what I understand, you want to make sure that new objects are not created when they are identical to what has been created before.

This is relatively easy, and would include either having a static map or a map inside another object, such as a ReflectionFactory. I'd personally go with ReflectionFactory as I don't like static things when you can avoid them.

Here's an example factory:

public class ReflexionFactory {
    private final Map&lt;Integer, Reflexion&gt; map = new HashMap&lt;&gt;();

    public ReflexionFactory() {
       for (boolean x : tf) {
            for (boolean y : tf) {
                for (boolean z : tf) {
                    Reflexion refl = new Reflexion(this, x, y, z);
                    map.put(refl.getKey(), refl);
                }
            }
        }
    }

    private Reflexion getReflection(int value) {
        return map.get(value);
    }

    Reflexion get(boolean x, boolean y, boolean z) {
        int value = 0;
        if (x) value += 1;
        if (y) value += 2;
        if (z) value += 4;
        return get(value);
    }

    public Set&lt;Reflexion&gt; all(Reflexion r) {
        ...
        for (boolean x : tf) {
            for (boolean y : tf) {
                for (boolean z : tf) {
                    out.add(this.get(x, y, z));
                }
            }
        }
        return out;
    }
}


Some changes in the Reflexion class:

public class Reflexion {

    Reflexion(ReflexionFactory factory, boolean x, boolean y, boolean z) {
        this.factory = factory;
        ...
    }

    public int getKey() {
        int value = 0;
        if (isFlippedX()) value += 1;
        if (isFlippedY()) value += 2;
        if (isFlippedZ()) value += 4;
        return value;
    }
}


There are a few methods I've left up to you to implement, but I hope you get the idea of them.

So what is the most important change?

The idea is to keep a map of all created reflections, stored with an id, and when you previously created the new reflection, you look them up through the factory (which contains the map).

Essentially, this creates what would be called a "Multiton". A class which has a limited amount of instances. (Compared to a "singleton" which only has one instance)