Session1 session1 = (Session1) getInitialContext().lookup("tutorial/Session1Bean/remote");
Session2 session2 = (Session2) getInitialContext().lookup("tutorial/Session2Bean/remote");
int oneF = session1.create1FromFactory();
int oneM = session1.create1FromManager();
int twoF = session1.create2FromFactory();
int twoM = session1.create2FromManager();
Entity1 one = session2.find1FromFactory(oneF);
System.out.println("factory: " + one.getString());
one = session2.find1FromManager(oneM);
System.out.println("manager: " + one.getString());
Entity2 two = session2.find2FromFactory(twoF);
System.out.println("factory: " + two.getString());
two = session2.find2FromManager(twoM);
System.out.println("manager: " + two.getString());