A non-static inner class has an implicit reference to its outer class instance. So when you serialize DummyClass, you're also serializing this implicit reference to the DummyClassTest instance owning it.
Define the DummyClass as a top-level class (non nested), or as a static inner class, and everything will work as expected.
The following:
public class DummyClassTest {
public class DummyClass {
}
}
is more or less equivalent to
public class DummyClassTest {
}
public class DummyClass {
private DummyClassTest outerInstance;
}