### Question:
SelectorHelper { public static Object getRestrictedValue(Selector selector, SelectorType type) throws ExecutionException { Object field = null; if (type != null && selector.getType() != type) { throw new ExecutionException("The selector type expected is: " + type + " but received: " + selector.getType()); } switch (selector.getType()) { case COLUMN: field = ((ColumnSelector) selector).getName().getName(); break; case BOOLEAN: field = ((BooleanSelector) selector).getValue(); break; case STRING: field = ((StringSelector) selector).getValue(); break; case INTEGER: field = ((IntegerSelector) selector).getValue(); break; case FLOATING_POINT: field = ((FloatingPointSelector) selector).getValue(); break; case GROUP: field = getRestrictedValue(((GroupSelector) selector).getFirstValue(), null); break; case LIST: if (((ListSelector) selector).getSelectorsList().isEmpty()){ throw new ExecutionException("Selector " + selector.getType() + " not supported get value operation."); } field = getRestrictedValue(((ListSelector)selector).getSelectorsList().get(0), null); break; default: throw new ExecutionException("Selector " + selector.getType() + " not supported get value operation."); } return field; } 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(expected = ExecutionException.class) public void getIncompatibleValueTest() throws Exception { SelectorHelper.getRestrictedValue(new ColumnSelector( new ColumnName(new TableName("catalog", "table"), "column")), SelectorType.BOOLEAN); }
@Test public void getRestrictedValueTest() throws Exception { String value = (String) SelectorHelper.getRestrictedValue(new ColumnSelector(new ColumnName(new TableName( "catalog", "table"), "column")), SelectorType.COLUMN); assertEquals("the value is not the expected", "column", value); }