### Question:
FilterAPI { public static SubscriptionData build(final String topic, final String subString, final String type) throws Exception { if (ExpressionType.TAG.equals(type) || type == null) { return buildSubscriptionData(null, topic, subString); } if (subString == null || subString.length() < 1) { throw new IllegalArgumentException("Expression can't be null! " + type); } SubscriptionData subscriptionData = new SubscriptionData(); subscriptionData.setTopic(topic); subscriptionData.setSubString(subString); subscriptionData.setExpressionType(type); return subscriptionData; }  static URL classFile(final String className); static String simpleClassName(final String className); static SubscriptionData buildSubscriptionData(final String consumerGroup, String topic,
        String subString); static SubscriptionData build(final String topic, final String subString,
                                         final String type);  }### Answer:
@Test public void testBuildTagSome() { try { SubscriptionData subscriptionData = FilterAPI.build( "TOPIC", "A || B", ExpressionType.TAG ); assertThat(subscriptionData).isNotNull(); assertThat(subscriptionData.getTopic()).isEqualTo("TOPIC"); assertThat(subscriptionData.getSubString()).isEqualTo("A || B"); assertThat(ExpressionType.isTagType(subscriptionData.getExpressionType())).isTrue(); assertThat(subscriptionData.getTagsSet()).isNotNull(); assertThat(subscriptionData.getTagsSet()).containsExactly("A", "B"); } catch (Exception e) { e.printStackTrace(); assertThat(Boolean.FALSE).isTrue(); } }
@Test public void testBuildSQL() { try { SubscriptionData subscriptionData = FilterAPI.build( "TOPIC", "a is not null", ExpressionType.SQL92 ); assertThat(subscriptionData).isNotNull(); assertThat(subscriptionData.getTopic()).isEqualTo("TOPIC"); assertThat(subscriptionData.getExpressionType()).isEqualTo(ExpressionType.SQL92); } catch (Exception e) { e.printStackTrace(); assertThat(Boolean.FALSE).isTrue(); } }
@Test public void testBuildSQLWithNullSubString() { try { FilterAPI.build( "TOPIC", null, ExpressionType.SQL92 ); assertThat(Boolean.FALSE).isTrue(); } catch (Exception e) { e.printStackTrace(); } }