MessagingContext implements Serializable { @Override public boolean equals( Object obj ) { return obj instanceof MessagingContext && this.kind == ((MessagingContext ) obj).kind && this.thoseThat == ((MessagingContext ) obj).thoseThat && Objects.equals( this.componentOrFacetName, ((MessagingContext ) obj).componentOrFacetName ) && Objects.equals( this.applicationName, ((MessagingContext ) obj).applicationName ); } MessagingContext( RecipientKind kind, String domain, String applicationName );  MessagingContext( RecipientKind kind, String domain, String topicName, String applicationName );  MessagingContext( RecipientKind kind, String domain, String componentOrFacetName, ThoseThat thoseThat, String applicationName ); RecipientKind getKind(); String getApplicationName(); String getComponentOrFacetName(); ThoseThat getAgentDirection(); String getDomain(); String getTopicName(); @Override int hashCode(); @Override boolean equals( Object obj ); @Override String toString(); static Collection<MessagingContext> forImportedVariables(
			String domain,
			String applicationName,
			Instance instance,
			ThoseThat thoseThat ); static List<MessagingContext> forExportedVariables(
			String domain,
			String applicationName,
			Instance instance,
			Map<String,String> externalExports,
			ThoseThat thoseThat );  }
@Test public void testEquals() { MessagingContext ctx = new MessagingContext( RecipientKind.DM, "domain", "whatever" ); Assert.assertEquals( ctx, new MessagingContext( RecipientKind.DM, "domain", "whatever", null, "whatever" )); Assert.assertEquals( ctx, ctx ); Assert.assertFalse( ctx.equals( new MessagingContext( RecipientKind.DM, "domain", null ))); Assert.assertFalse( ctx.equals( new MessagingContext( RecipientKind.DM, "domain", "whatever2" ))); Assert.assertFalse( ctx.equals( new MessagingContext( RecipientKind.AGENTS, "domain", null ))); Assert.assertFalse( ctx.equals( new MessagingContext( RecipientKind.INTER_APP, "domain", null ))); Assert.assertFalse( ctx.equals( new Object())); ctx = new MessagingContext( RecipientKind.INTER_APP, "domain", "facet", ThoseThat.EXPORT, "app" ); Assert.assertEquals( ctx, new MessagingContext( RecipientKind.INTER_APP, "domain", "facet", ThoseThat.EXPORT, "app2" )); Assert.assertEquals( ctx, new MessagingContext( RecipientKind.INTER_APP, "domain", "facet", ThoseThat.EXPORT, "app3" )); Assert.assertEquals( ctx, ctx ); Assert.assertFalse( ctx.equals( new MessagingContext( RecipientKind.INTER_APP, "domain", "facet", ThoseThat.IMPORT, "app" ))); Assert.assertFalse( ctx.equals( new MessagingContext( RecipientKind.INTER_APP, "domain", "facet2", ThoseThat.EXPORT, "app" ))); Assert.assertFalse( ctx.equals( new MessagingContext( RecipientKind.AGENTS, "domain", "facet", ThoseThat.EXPORT, "app" ))); Assert.assertFalse( ctx.equals( new Object())); ctx = new MessagingContext( RecipientKind.AGENTS, "domain", "facet", ThoseThat.EXPORT, null ); Assert.assertFalse( ctx.equals( new MessagingContext( RecipientKind.AGENTS, "domain", "facet", ThoseThat.IMPORT, null ))); Assert.assertFalse( ctx.equals( new MessagingContext( RecipientKind.INTER_APP, "domain", "facet", ThoseThat.EXPORT, null ))); Assert.assertFalse( ctx.equals( new MessagingContext( RecipientKind.AGENTS, "domain", "facet2", ThoseThat.EXPORT, null ))); Assert.assertFalse( ctx.equals( new MessagingContext( RecipientKind.AGENTS, "domain", "facet", ThoseThat.EXPORT, "app" ))); Assert.assertEquals( ctx, ctx ); }