### Question:
SelectorHelper { public static Class getClass(Selector selector) throws ExecutionException { Class returnClass = null; switch (selector.getType()) { case STRING: case COLUMN: returnClass = String.class; break; case BOOLEAN: returnClass = Boolean.class; break; case INTEGER: returnClass = Long.class; break; case FLOATING_POINT: returnClass = Double.class; break; case GROUP: returnClass = getClass(((GroupSelector) selector).getFirstValue()); break; case LIST: if (((ListSelector) selector).getSelectorsList().isEmpty()){ throw new ExecutionException("Selector " + selector.getType() + " not supported get value operation."); } returnClass = getClass(((ListSelector) selector).getSelectorsList().get(0)); break; default: throw new ExecutionException("Selector " + selector.getType() + " not supported get value operation."); } return returnClass; } private  SelectorHelper(); static T getValue(Class<T> type, Selector selector); static Object getValue(Selector selector); static Object getRestrictedValue(Selector selector, SelectorType type); static Class getClass(Selector selector);  }### Answer:
@Test public void testGetClass() throws ExecutionException { Selector[] selector = {new StringSelector(""), new ColumnSelector(mock(ColumnName.class)), new BooleanSelector(true), new FloatingPointSelector("1"), new IntegerSelector(1)}; Class[] returnClass = {String.class, String.class, Boolean.class, Double.class, Long.class}; for (int i = 0; i < selector.length; i++) { assertEquals("The retur class is correct", returnClass[i], SelectorHelper.getClass(selector[i])); } }
@Test public void testGetClassException() { Selector[] exceptionSelector = { new AsteriskSelector(), new FunctionSelector("", SelectExpression.create(new LinkedList<ColumnName>())), new RelationSelector(mock(Relation.class))}; for (int i = 0; i < exceptionSelector.length; i++) { try { SelectorHelper.getClass(exceptionSelector[i]); fail("Test should have failed"); } catch (ExecutionException e) { e.printStackTrace(); } } }