QueryUtils { public static String parseSelectFields( List<String> fields ) { if ( fields == null || fields.isEmpty() ) { return " * "; } else { String str = StringUtils.EMPTY; for ( int i = 0; i < fields.size(); i++ ) { str += fields.get( i ); if ( i < fields.size() - 1 ) { str += ","; } } return str; } }  static T parseValue( Class<T> klass, Object objectValue ); @SuppressWarnings( "unchecked" ) static T parseValue( Class<T> klass, Class<?> secondaryKlass, Object objectValue ); @SuppressWarnings( { "unchecked", "rawtypes" } ) static T getEnumValue( Class<T> klass, String value ); static Object parseValue( String value ); static String parseSelectFields( List<String> fields ); static String convertCollectionValue( String value ); static String parseFilterOperator( String operator, String value ); @Nonnull static List<Order> convertOrderStrings( @Nullable Collection<String> orders, @Nonnull Schema schema ); static T getSingleResult( TypedQuery<T> query );  }
@Test public void testParseSelectFields() { List<String> fields = new ArrayList<>(); fields.add( "ABC" ); fields.add( "DEF" ); assertEquals( "ABC,DEF", QueryUtils.parseSelectFields( fields ) ); }
@Test public void testParseSelectFieldsNull() { assertEquals( " * ", QueryUtils.parseSelectFields( null ) ); }