void (String[] args) { DataWithGeneric176<Integer> test = new DataWithGeneric176<Integer>(123, new Runnable() { @Override public void run() { System.out.println("Run"); } }); test.getCallback(); System.out.println(test.getCommand()); DataWithGeneric176<String> foo = DataWithGeneric176.of("fooqwqww", new Runnable() { public void run() { } }); foo.getCallback(); System.out.println(foo.getCommand()); }