RequestLogicalOperator implements RequestObject { public static RequestLogicalOperator of(String logicalOperator) { return of(LogicalOperatorType.fromString(logicalOperator)); } private  RequestLogicalOperator(LogicalOperatorType logicalOperator); static RequestLogicalOperator of(String logicalOperator); static RequestLogicalOperator of(LogicalOperatorType logicalOperatorType); LogicalOperatorType getOperator(); @Override RequestObjectType getType(); @Override String toString(); @Override final boolean equals(Object obj); @Override final int hashCode();  }
@Test(expected = IllegalArgumentException.class) public void testOfMethodShouldFailWhenIncorrectLogicalOperatorSpecified() throws Exception { RequestLogicalOperator requestLogicalOperator = RequestLogicalOperator.of("wrongLogicalOperator"); }
@Test public void testTwoDifferentObjectsEqualsWhenSameNameGiven() throws Exception { RequestLogicalOperator requestLogicalOperator = RequestLogicalOperator.of("$or"); assertThat(requestLogicalOperator).isEqualTo(RequestLogicalOperator.of("$or")); }