Convert { @SuppressWarnings("unchecked") public static <T> T possibleThriftToJava(Object tobject) { if(tobject instanceof TObject) { return (T) thriftToJava((TObject) tobject); } else if(tobject instanceof List) { return (T) ((List<?>) tobject).stream() .map(Convert::possibleThriftToJava) .collect(Collectors.toList()); } else if(tobject instanceof Set) { return (T) ((Set<?>) tobject).stream() .map(Convert::possibleThriftToJava) .collect(Collectors.toSet()); } else if(tobject instanceof Map) { return (T) ((Map<?, ?>) tobject).entrySet().stream() .collect(Collectors.toMap( e -> possibleThriftToJava(e.getKey()), e -> possibleThriftToJava(e.getValue()))); } else { return (T) tobject; } } private  Convert(); static List<Multimap<String, Object>> anyJsonToJava(String json); static TObject javaToThrift(Object object); static Multimap<String, Object> jsonToJava(String json); @SuppressWarnings("unchecked") static String mapsToJson(Collection<Multimap<String, Object>> list); static String mapToJson(Map<String, ?> map); static String mapToJson(Multimap<String, Object> map); static String operatorToString(Operator operator); @SuppressWarnings("unchecked") static T possibleThriftToJava(Object tobject); static Object stringToJava(String value); static Operator stringToOperator(String symbol); static String stringToResolvableLinkInstruction(String ccl); @Deprecated static String stringToResolvableLinkSpecification(String key,
            String rawValue); static Object thriftToJava(TObject object); static Object toFunctionOrUnescapedValueIfPossible(Object value);  }
@Test public void testPossibleThriftToJavaAlreadyJava() { Object expected = Random.getObject(); Object actual = Convert.possibleThriftToJava(expected); Assert.assertEquals(expected, actual); }