/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
class OnibusBiTrem extends Bus implements IMultiplosVagoes {}
class Bus extends Car{}
class Car implements HasPassengers{}
interface HasPassengers{}
interface IMultiplosVagoes {}
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
{
OnibusBiTrem oni = new OnibusBiTrem();
Class<?> classes = oni.getClass();
Set<String> items = new HashSet<>() ;
SetInterfaces(classes, items)
.forEach((item) -> {
});
}
public static Set<String> SetInterfaces(Class<?> aClass,
Set<String> items)
{
for (Class<?> intf : aClass.getInterfaces()) {
items.add(intf.getName());
SetInterfaces(intf, items);
}
if (aClass.isInterface() == false && aClass.getSuperclass() != null) {
SetInterfaces(aClass.getSuperclass(), items);
}
return items;
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgpjbGFzcyBPbmlidXNCaVRyZW0gZXh0ZW5kcyBCdXMgaW1wbGVtZW50cyBJTXVsdGlwbG9zVmFnb2VzIHt9CmNsYXNzIEJ1cyBleHRlbmRzIENhcnt9CmNsYXNzIENhciBpbXBsZW1lbnRzIEhhc1Bhc3NlbmdlcnN7fQppbnRlcmZhY2UgSGFzUGFzc2VuZ2Vyc3t9CmludGVyZmFjZSBJTXVsdGlwbG9zVmFnb2VzIHt9Ci8qIE5hbWUgb2YgdGhlIGNsYXNzIGhhcyB0byBiZSAiTWFpbiIgb25seSBpZiB0aGUgY2xhc3MgaXMgcHVibGljLiAqLwpjbGFzcyBJZGVvbmUKewoJcHVibGljIHN0YXRpYyB2b2lkIG1haW4gKFN0cmluZ1tdIGFyZ3MpIHRocm93cyBqYXZhLmxhbmcuRXhjZXB0aW9uCgl7CgkJT25pYnVzQmlUcmVtIG9uaSA9IG5ldyBPbmlidXNCaVRyZW0oKTsKICAgICAgICBDbGFzczw/PiBjbGFzc2VzID0gb25pLmdldENsYXNzKCk7IAogICAgICAgIFNldDxTdHJpbmc+IGl0ZW1zID0gbmV3IEhhc2hTZXQ8PigpIDsgICAgICAgIAogICAgICAgIFNldEludGVyZmFjZXMoY2xhc3NlcywgaXRlbXMpCiAgICAgICAgICAgICAgICAuZm9yRWFjaCgoaXRlbSkgLT4gewogICAgICAgICAgICAgICAgICAgICBTeXN0ZW0ub3V0LnByaW50bG4oaXRlbSk7CiAgICAgICAgICAgICAgICAgfSk7Cgl9CglwdWJsaWMgc3RhdGljIFNldDxTdHJpbmc+IFNldEludGVyZmFjZXMoQ2xhc3M8Pz4gYUNsYXNzLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU2V0PFN0cmluZz4gaXRlbXMpCiAgICB7ICAgICAgICAgICAKICAgICAgICBmb3IgKENsYXNzPD8+IGludGYgOiBhQ2xhc3MuZ2V0SW50ZXJmYWNlcygpKSB7CiAgICAgICAgICAgIGl0ZW1zLmFkZChpbnRmLmdldE5hbWUoKSk7IAogICAgICAgICAgICBTZXRJbnRlcmZhY2VzKGludGYsIGl0ZW1zKTsgICAgICAgICAgICAKICAgICAgICB9CiAgICAgICAgaWYgKGFDbGFzcy5pc0ludGVyZmFjZSgpID09IGZhbHNlICYmIGFDbGFzcy5nZXRTdXBlcmNsYXNzKCkgIT0gbnVsbCkgewogICAgICAgICAgICBTZXRJbnRlcmZhY2VzKGFDbGFzcy5nZXRTdXBlcmNsYXNzKCksIGl0ZW1zKTsKICAgICAgICB9ICAgICAgICAKICAgICAgICByZXR1cm4gaXRlbXM7CiAgICB9Cn0=