--- /dev/null
+package iotrmi.Java.sample;
+
+import java.util.Set;
+
+public class TestClass {
+
+ /**
+ * Class Properties
+ */
+ private int intA;
+ private float floatB;
+ private String stringC;
+ private CallBackInterface cb;
+
+ /**
+ * Constructors
+ */
+ public TestClass() {
+
+ intA = 1;
+ floatB = 2;
+ stringC = "345";
+ cb = null;
+ }
+
+
+ public TestClass(int _int, float _float, String _string) {
+
+ intA = _int;
+ floatB = _float;
+ stringC = _string;
+ }
+
+
+ public void setA(int _int) {
+
+ intA = _int;
+ }
+
+
+ public void setB(float _float) {
+
+ floatB = _float;
+ }
+
+
+ public void setC(String _string) {
+
+ stringC = _string;
+ }
+
+
+ // Getters
+ public String sumArray(String[] newA) {
+
+ String sum = "";
+ for (String i : newA)
+ sum = sum + i;
+ return sum;
+ }
+
+
+ public int setAndGetA(int newA) {
+
+ intA = newA;
+ return intA;
+ }
+
+
+ public int setACAndGetA(String newC, int newA) {
+
+ stringC = newC;
+ intA = newA;
+ return intA;
+ }
+
+
+ public void registerCallback(CallBackInterface _cb) {
+
+ cb = _cb;
+ }
+
+
+ public int callBack() {
+
+ System.out.println("This callBack function is called inside TestClass!");
+ return cb.printInt();
+ }
+
+
+ public static void main(String[] args) {
+
+ TestClass tc = new TestClass();
+ CallBack cb = new CallBack(3);
+
+ tc.registerCallback(cb);
+ System.out.println("Return value: " + tc.callBack());
+ }
+}