public Attachement(String name, Interface from, Interface to) throws NoDifferentsTypesException { super(name); if (from.getType().equals(to.getType())) { throw new NoDifferentsTypesException(); } super.setFrom(from); super.setTo(to); }