Overriding static method with different static variable in java
From time to time one sees this wish. I never needed it, but the way is to have one global repository in the base class:
public abstract class Animal {
    private static final Map&lt;Class&lt;? extends Animal&gt;, List&lt;Animal&gt;&gt; all =
            new HashMap&lt;&gt;();

    protected Animal() {
        List&lt;Animal&gt; species = all.computeIfAbsent(getClass(),
                type -&gt; new ArrayList&lt;&gt;());
        species.add(this);
    }

    public static Stream&lt;T extends Animal&gt; all(Class&lt;T&gt; type) {
        return all.computeIfAbsent(getClass(), 
               type -&gt; new ArrayList&lt;&gt;()).stream().map(type::cast);
    }

Instead of storing the Animal child instance one could use a WeakReference&lt;Animal&gt; to let animals disappear when not used.
A call to Animal.all(Dog.class) needs no Animal instance.