code: /*
  ParenPad
  option = (default)NOSPACE
  tokens = (default)ANNOTATION, ANNOTATION_FIELD_DEF, CTOR_CALL, CTOR_DEF, DOT, \
           ENUM_CONSTANT_DEF, EXPR, LITERAL_CATCH, LITERAL_DO, LITERAL_FOR, LITERAL_IF, \
           LITERAL_NEW, LITERAL_SWITCH, LITERAL_SYNCHRONIZED, LITERAL_WHILE, METHOD_CALL, \
           METHOD_DEF, QUESTION, RESOURCE_SPECIFICATION, SUPER_CTOR_CALL, LAMBDA, RECORD_DEF
  
  
  */
  
  package com.puppycrawl.tools.checkstyle.checks.whitespace.parenpad;
  
  import java.io.IOException;
  import java.io.StringWriter;
  import java.io.Writer;
  
  public class InputParenPadLeftRightAndNoSpace1
  {
      class ParenPadNoSpace  {
          ParenPadNoSpace() {
              this(0);
          }
  
          ParenPadNoSpace(int i) {
              super();
          }
  
          @SuppressWarnings("")
          void method(boolean status) {
              try (Writer writer = new StringWriter()) {
                  do {
                      writer.append("a");
                  } while (status);
              } catch (IOException e) {
                  while (status) {
                      for (int i = 0; i < (long) (2 * (4 / 2)); i++) {
                          if (i > 2) {
                              synchronized (this) {
                                  switch (i) {
                                      case 3:
                                      case (4):
                                      case 5:
                                          break;
                                  }
                              }
                          }
                      }
                  }
              }
          }
      }
  
      class ParenPadSpaceLeft {
          ParenPadSpaceLeft( ) { // 2 violations
              this( 0); // violation
          }
  
          ParenPadSpaceLeft( int i) { // violation
              super( ); // 2 violations
          }
  
          @SuppressWarnings( "") // violation
          void method( boolean status) { // violation
              try ( Writer writer = new StringWriter( )) { // 3 violations
                  do {
                      writer.append("a");
                  } while ( status); // violation
              } catch ( IOException e) { // violation
                  while ( status) { // violation
                      for ( int i = 0; i < ( long) ( 2 * ( 4 / 2)); i++) { // 3 violations
                          if ( i > 2) { // violation
                              synchronized ( this) { // violation
                                  switch ( i) { // violation
                                      case 3:
                                      case ( 4): // violation
                                      case 5:
                                          break;
                                  }
                              }
                          }
                      }
                  }
              }
          }
      }
  
      class ParenPadSpaceRight {
          ParenPadSpaceRight( ) { // 2 violations
              this(0 ); // violation
          }
  
          ParenPadSpaceRight(int i ) { // violation
              super( ); // 2 violations
          }
  
          @SuppressWarnings("" ) // violation
          void method(boolean status ) { // violation
              try (Writer writer = new StringWriter( ) ) { // 3 violations
                  do {
                      writer.append("a" ); // violation
                  } while (status ); // violation
              } catch (IOException e ) { // violation
                  while (status ) { // violation
                      for (int i = 0; i < (long ) (2 * (4 / 2 ) ); i++ ) { // 3 violations
                          if (i > 2 ) { // violation
                              synchronized (this ) { // violation
                                  switch (i ) { // violation
                                      case 3:
                                      case (4 ): // violation
                                      case 5:
                                          break;
                                  }
                              }
                          }
                      }
                  }
              }
          }
      }
  
      String foo() {
          return ( (Object // violation
                  ) bar( ( 1 > 2 ) ? // 3 violations
                          ( ( 3 < 4 )? false : true ) : // 4 violations
                          ( ( 1 == 1 ) ? false : true) ) ).toString(); // 5 violations
      }
      @MyAnnotation1
      public boolean bar(boolean a) {
          assert ( true ); // 2 violations
          return true;
      }
  
      boolean fooo = this.bar(( true && false ) && true); // 2 violations
  }
  @interface MyAnnotation1 {
      String someField( ) default "Hello world"; // 2 violations
  }
  
  enum MyEnum1 {
      SOME_CONSTANT( ) { // 2 violations
          int i = (int) (2 * (4 / 2)
                  );
      };
  
      public void myMethod() {
          String s = "test";
          Object o = s;
          ((String)o).length();
          ( (String)o ).length(); // 2 violations
      }
  
      public void crisRon() {
          Object leo = "messi";
          Object ibra = leo;
          ((String)leo).compareTo( (String)ibra ); // 2 violations
          Math.random();
      }
  
      public void intStringConv() {
          Object a = 5;
          Object b = "string";
          int w = Integer.parseInt((String)a);
          int x = Integer.parseInt( (String)a); // violation
          double y = Double.parseDouble((String)a ); // violation
          float z = Float.parseFloat( (String)a ); // 2 violations
          String d = ((String)b);
      }
  
      public int something( Object o ) { // 2 violations
          if ( o == null || !( o instanceof Float ) ) { // 4 violations
              return -1;
          }
          return Integer.valueOf( 22 ).compareTo( (Integer) o ); // 4 violations
      }
  
      private void launch(Integer number ) { // violation
          String myInt = ( number.toString() + '\0' ); // 2 violations
          boolean result = false;
          if (number == 123)
              result = true;
      }
  
      private static String getterName( Exception t) { // violation
          if (t instanceof ClassNotFoundException ) { // violation
              return ( (ClassNotFoundException) t ).getMessage(); // 2 violations
          }
          else {
              return "?";
          }
      }
  
      private Object exam;
  
      public String testing() {
          return ( this.exam != null ) // 2 violations
                  ? ( ( Enum )this.exam ).name() // 2 violations
                  : null;
      }
  
      Object stringReturnValue( Object result ) { // 2 violations
          if ( result instanceof String ) { // 2 violations
              result = ( (String) result ).length(); // 2 violations
          }
          return result;
      }
  
  
  
      private void except() { // 2 violations below
          java.util.ArrayList<Integer> arrlist = new java.util.ArrayList<Integer>( 5 );
          arrlist.add( 20); // violation
          arrlist.add(15 ); // violation
          arrlist.add( 30 ); // 2 violations
          arrlist.add(45);
          try {
              ( arrlist ).remove( 2); // 3 violations
          } catch ( IndexOutOfBoundsException x ) { // 2 violations
              x.getMessage();
          }
          org.junit.Assert.assertThat( "123", org.hamcrest.CoreMatchers.is( "123" ) ); // 4 violations
          org.junit.Assert.assertThat( "Help! Integers don't work", // violation
                  0, org.hamcrest.CoreMatchers.is( 1 ) ); // 3 violations
      }
  }
  enum MyEnum21 {
      SOME_CONSTANT( ) { // 2 violations
          int i = (int) (2 * (4 / 2
  )                   ); // violation
      };
  }
  